From 674fdc43048e21fba446cbefaa7a28939ea946ff Mon Sep 17 00:00:00 2001 From: Krishna Srinivas Date: Wed, 17 Aug 2016 12:46:59 +0530 Subject: [PATCH] redirect-middleware: Redirect to /minio only if client is a browser and the request is not V4 signed. (#2469) fixes #2356 --- generic-handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic-handlers.go b/generic-handlers.go index 3ca803a55..da5f80554 100644 --- a/generic-handlers.go +++ b/generic-handlers.go @@ -77,7 +77,7 @@ func setBrowserRedirectHandler(h http.Handler) http.Handler { func (h redirectHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Re-direction handled specifically for browsers. - if strings.Contains(r.Header.Get("User-Agent"), "Mozilla") { + if strings.Contains(r.Header.Get("User-Agent"), "Mozilla") && !isRequestSignatureV4(r) { // '/' is redirected to 'locationPrefix/' // '/webrpc' is redirected to 'locationPrefix/webrpc' // '/login' is redirected to 'locationPrefix/login'