diff options
| author | Jeff Carr <[email protected]> | 2025-09-05 14:16:45 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-05 14:17:30 -0500 |
| commit | c0b9518c0db72aa40e4e37e3d90341b32b364bd5 (patch) | |
| tree | c05dc34bfc87cfcc4582a5dc5988a7a8f3339dce | |
| parent | a9dbfb9201f556e4df4d5c8234bedcc9d7c33052 (diff) | |
set route in PB
| -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 +} |
