1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-06-15 00:15:00 +02:00

Track the ReverseProxy option in the request Scope

This allows for proper handling of reverse proxy based headers throughout
the lifecycle of a request.
This commit is contained in:
Nick Meves
2020-12-23 17:42:02 -08:00
parent 8e02fac2cc
commit b625de9490
4 changed files with 29 additions and 17 deletions

View File

@ -231,7 +231,7 @@ func NewOAuthProxy(opts *options.Options, validator func(string) bool) (*OAuthPr
// the OAuth2 Proxy authentication logic kicks in.
// For example forcing HTTPS or health checks.
func buildPreAuthChain(opts *options.Options) (alice.Chain, error) {
chain := alice.New(middleware.NewScope())
chain := alice.New(middleware.NewScope(opts))
if opts.ForceHTTPS {
_, httpsPort, err := net.SplitHostPort(opts.HTTPSAddress)