From 3f72c7fcc72c41c03ceac6f511ad8164f5bd572d Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 12 Dec 2023 16:16:26 -0800 Subject: [PATCH] healthcheck requests with user-agent mozilla do not need redirects (#18642) apparently, windows powershell curl has this abhorrent behavior --- cmd/generic-handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/generic-handlers.go b/cmd/generic-handlers.go index b55e99fa8..3e1625c8d 100644 --- a/cmd/generic-handlers.go +++ b/cmd/generic-handlers.go @@ -153,7 +153,7 @@ func setBrowserRedirectMiddleware(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { read := r.Method == http.MethodGet || r.Method == http.MethodHead // Re-direction is handled specifically for browser requests. - if guessIsBrowserReq(r) && read && globalBrowserRedirect { + if !guessIsHealthCheckReq(r) && guessIsBrowserReq(r) && read && globalBrowserRedirect { // Fetch the redirect location if any. if u := getRedirectLocation(r); u != nil { // Employ a temporary re-direct.