Don't redirect if TLS is already in use

chubin/logging
Igor Chubin 2 years ago
parent b2b918637e
commit ff4f258f2d

@ -145,7 +145,7 @@ func redirectInsecure(req *http.Request) (*responseWithHeader, bool) {
return nil, false
}
if strings.ToLower(req.Header.Get("X-Forwarded-Proto")) == "https" {
if req.TLS != nil || strings.ToLower(req.Header.Get("X-Forwarded-Proto")) == "https" {
return nil, false
}

Loading…
Cancel
Save