mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
introduce MINIO_BROWSER_REDIRECT env to enable/disable auto-redirect (#18025)
This commit is contained in:
@@ -152,7 +152,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 {
|
||||
if guessIsBrowserReq(r) && read && globalBrowserRedirect {
|
||||
// Fetch the redirect location if any.
|
||||
if u := getRedirectLocation(r); u != nil {
|
||||
// Employ a temporary re-direct.
|
||||
|
||||
Reference in New Issue
Block a user