Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app.go
diff options
context:
space:
mode:
authorJaime Martinez <jmartinez@gitlab.com>2020-02-19 04:27:47 +0300
committerJaime Martinez <jmartinez@gitlab.com>2020-02-19 04:27:47 +0300
commit6dcd9b539eb211034c00a46818cdc32820a95d9a (patch)
tree13bb065106424e95b25479ea759a2426fdde56f7 /app.go
parent52ec229a3cf3f5df82e31f00119259669113317c (diff)
Remove request.WithHTTPSFlag and set directly in tests
Diffstat (limited to 'app.go')
-rw-r--r--app.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/app.go b/app.go
index 312d171f..2626be49 100644
--- a/app.go
+++ b/app.go
@@ -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) {