set route in PB

This commit is contained in:
Jeff Carr 2025-09-05 14:16:45 -05:00
parent a9dbfb9201
commit c0b9518c0d
1 changed files with 7 additions and 0 deletions

View File

@ -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
}