mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
Redirect browser requests only if browser is enabled (#6909)
This PR fixes an issue introduced in PR #6848, when browser is disabled we shouldn't re-direct the requests returning AccessDenied. Fixes #6907
This commit is contained in:
parent
18ced1102c
commit
20e61fb362
@ -575,7 +575,9 @@ func writeErrorResponse(w http.ResponseWriter, errorCode APIErrorCode, reqURL *u
|
||||
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
|
||||
w.Header().Set("Retry-After", "120")
|
||||
case ErrAccessDenied:
|
||||
if browser {
|
||||
// The request is from browser and also if browser
|
||||
// is enabled we need to redirect.
|
||||
if browser && globalIsBrowserEnabled {
|
||||
w.Header().Set("Location", minioReservedBucketPath+reqURL.Path)
|
||||
w.WriteHeader(http.StatusTemporaryRedirect)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user