diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2020-02-19 04:27:47 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2020-02-19 04:27:47 +0300 |
commit | 6dcd9b539eb211034c00a46818cdc32820a95d9a (patch) | |
tree | 13bb065106424e95b25479ea759a2426fdde56f7 /app.go | |
parent | 52ec229a3cf3f5df82e31f00119259669113317c (diff) |
Remove request.WithHTTPSFlag and set directly in tests
Diffstat (limited to 'app.go')
-rw-r--r-- | app.go | 8 |
1 files changed, 1 insertions, 7 deletions
@@ -280,10 +280,6 @@ func (a *theApp) httpInitialMiddleware(handler http.Handler) http.Handler { // proxyInitialMiddleware sets up proxy requests func (a *theApp) proxyInitialMiddleware(handler http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - forwardedProto := r.Header.Get(xForwardedProto) - https := forwardedProto == xForwardedProtoHTTPS - - r = request.WithHTTPSFlag(r, https) if forwardedHost := r.Header.Get(xForwardedHost); forwardedHost != "" { r.Host = forwardedHost } @@ -294,16 +290,14 @@ func (a *theApp) proxyInitialMiddleware(handler http.Handler) http.Handler { // setRequestScheme will update r.URL.Scheme if empty based on r.TLS func setRequestScheme(r *http.Request) *http.Request { - https := false if r.URL.Scheme == request.SchemeHTTPS || r.TLS != nil { // make sure is set for non-proxy requests r.URL.Scheme = request.SchemeHTTPS - https = true } else { r.URL.Scheme = request.SchemeHTTP } - return request.WithHTTPSFlag(r, https) + return r } func (a *theApp) buildHandlerPipeline() (http.Handler, error) { |