diff --git a/http.go b/http.go index 0e3a56b..27d6e06 100644 --- a/http.go +++ b/http.go @@ -118,6 +118,7 @@ func (pb *Patches) AddHttpToPB(r *http.Request) error { Host: r.Host, Hostname: r.Header.Get("hostname"), } + pb.HttpRequest.Route = cleanURL(r.URL.Path) return nil } @@ -146,3 +147,9 @@ func getClientIP(r *http.Request) string { } return host } + +// remove '?' part and trailing '/' +func cleanURL(url string) string { + url = "/" + strings.Trim(url, "/") + return url +}