From a6bdc086a2d6bea2388213ce36a4945e2ebbca95 Mon Sep 17 00:00:00 2001 From: Dmitry Gadeev Date: Sat, 2 May 2020 11:53:01 +0500 Subject: [PATCH] fix: use source scheme retrieved from X-Forwarded headers (#9483) --- cmd/web-handlers.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cmd/web-handlers.go b/cmd/web-handlers.go index 6d449c789..a26a57311 100644 --- a/cmd/web-handlers.go +++ b/cmd/web-handlers.go @@ -2058,12 +2058,6 @@ type LoginSTSArgs struct { Token string `json:"token" form:"token"` } -// LoginSTSRep - login reply. -type LoginSTSRep struct { - Token string `json:"token"` - UIVersion string `json:"uiVersion"` -} - // LoginSTS - STS user login handler. func (web *webAPIHandlers) LoginSTS(r *http.Request, args *LoginSTSArgs, reply *LoginRep) error { ctx := newWebContext(r, args, "WebLoginSTS") @@ -2074,6 +2068,9 @@ func (web *webAPIHandlers) LoginSTS(r *http.Request, args *LoginSTSArgs, reply * v.Set("Version", stsAPIVersion) scheme := "http" + if sourceScheme := handlers.GetSourceScheme(r); sourceScheme != "" { + scheme = sourceScheme + } if globalIsSSL { scheme = "https" }