khatru: WithServiceURL() subhandlers.

This commit is contained in:
fiatjaf
2026-04-15 21:19:03 -03:00
parent 7dc553f71b
commit d56bdba3ff
4 changed files with 74 additions and 4 deletions
+2 -2
View File
@@ -43,8 +43,8 @@ func (rl *Relay) ServeHTTP(w http.ResponseWriter, r *http.Request) {
})
relayPathMatches := true
if rl.ServiceURL != "" {
p, err := url.Parse(rl.ServiceURL)
if serviceURL := rl.getServiceURL(r); serviceURL != "" {
p, err := url.Parse(serviceURL)
if err == nil {
relayPathMatches = strings.TrimSuffix(r.URL.Path, "/") == strings.TrimSuffix(p.Path, "/")
}