fix: use source scheme retrieved from X-Forwarded headers (#9483)

This commit is contained in:
Dmitry Gadeev 2020-05-02 11:53:01 +05:00 committed by GitHub
parent 1242dd951a
commit a6bdc086a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 6 deletions

View File

@ -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"
}