Been too long since i did anything, can't remember what the hell is in all this....
This commit is contained in:
@@ -2,7 +2,6 @@ package middleware
|
||||
|
||||
import "net/http"
|
||||
|
||||
// Redirects all HTTP to HTTPS (only in production)
|
||||
func EnforceHTTPS(next http.Handler, enabled bool) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if enabled && r.Header.Get("X-Forwarded-Proto") != "https" && r.TLS == nil {
|
||||
|
||||
Reference in New Issue
Block a user