From 77f9c71133ff47c8812c0e3b27232a1e0b66d705 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 28 Apr 2021 12:22:04 -0700 Subject: [PATCH] Revert "redirect to console project for browser (#12172)" This reverts commit 301669cf7b03949f372e2d86e60494becae2092e. fixes #12179 --- cmd/generic-handlers.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/cmd/generic-handlers.go b/cmd/generic-handlers.go index 18c039362..360b15e51 100644 --- a/cmd/generic-handlers.go +++ b/cmd/generic-handlers.go @@ -131,26 +131,8 @@ const ( loginPathPrefix = SlashSeparator + "login" ) -// guessIsBrowserReq - returns true if the request is browser. -// This implementation just validates user-agent and -// looks for "Mozilla" string. This is no way certifiable -// way to know if the request really came from a browser -// since User-Agent's can be arbitrary. But this is just -// a best effort function. -func guessIsBrowserReq(req *http.Request) bool { - if req == nil { - return false - } - aType := getRequestAuthType(req) - return strings.Contains(req.Header.Get("User-Agent"), "Mozilla") && (aType == authTypeJWT || aType == authTypeAnonymous) -} - func setRedirectHandler(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if guessIsBrowserReq(r) { - http.Redirect(w, r, "https://github.com/minio/console", http.StatusMovedPermanently) - return - } if !shouldProxy() || guessIsRPCReq(r) || guessIsHealthCheckReq(r) || guessIsMetricsReq(r) || isAdminReq(r) { h.ServeHTTP(w, r)