diff options
Diffstat (limited to 'http.go')
| -rw-r--r-- | http.go | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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 +} |
