You've already forked oauth2-proxy
mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-08-06 22:42:56 +02:00
Enable UseEncodedPath() for frontend mux
This allows urls with encoded characters (e.g.: /%2F/) to pass to the upstream mux instead of triggering a HTTP 301 from the frontend. Otherwise a /%2F/test/ will result in a HTTP 301 -> /test/
This commit is contained in:
@ -265,7 +265,9 @@ func (p *OAuthProxy) setupServer(opts *options.Options) error {
|
||||
}
|
||||
|
||||
func (p *OAuthProxy) buildServeMux(proxyPrefix string) {
|
||||
r := mux.NewRouter()
|
||||
// Use the encoded path here so we can have the option to pass it on in the upstream mux.
|
||||
// Otherwise something like /%2F/ would be redirected to / here already.
|
||||
r := mux.NewRouter().UseEncodedPath()
|
||||
// Everything served by the router must go through the preAuthChain first.
|
||||
r.Use(p.preAuthChain.Then)
|
||||
|
||||
|
Reference in New Issue
Block a user