feat: match proxy's from on whole targeted url
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good

This commit is contained in:
2024-03-29 09:21:01 +01:00
parent f548c8c8e7
commit 274bef13d8
2 changed files with 29 additions and 2 deletions

View File

@ -2,6 +2,7 @@ package director
import (
"net/http"
"net/url"
"forge.cadoles.com/Cadoles/go-proxy"
"forge.cadoles.com/Cadoles/go-proxy/util"
@ -16,3 +17,19 @@ func createMiddlewareChain(handler http.Handler, middlewares []proxy.Middleware)
return handler
}
func getRequestURL(r *http.Request) *url.URL {
scheme := "http"
if r.URL.Scheme != "" {
scheme = r.URL.Scheme
}
url := url.URL{
Host: r.Host,
Scheme: scheme,
Path: r.URL.Path,
RawQuery: r.URL.RawQuery,
}
return &url
}