This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
func (a *App) httpsEnforcementMiddleware(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// Skip HTTPS enforcement for health checks and localhost
|
||||
if a.isPublicEndpoint(r.URL.Path) || isLocalhost(r) {
|
||||
if a.isPublicEndpoint(r.URL.Path, r.Method) || isLocalhost(r) {
|
||||
next.ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
@@ -53,7 +53,7 @@ func isLocalhost(r *http.Request) bool {
|
||||
func (a *App) requireHTTPSMiddleware(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// Skip for health checks
|
||||
if a.isPublicEndpoint(r.URL.Path) {
|
||||
if a.isPublicEndpoint(r.URL.Path, r.Method) {
|
||||
next.ServeHTTP(w, r)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user