diff --git a/cmd/bucket-policy.go b/cmd/bucket-policy.go index 4a2bd9249..24798a490 100644 --- a/cmd/bucket-policy.go +++ b/cmd/bucket-policy.go @@ -125,10 +125,15 @@ func getConditionValues(r *http.Request, lc string, cred auth.Credentials) map[s authtype = "POST" } + secureTransport := r.TLS != nil + if forwardedScheme := handlers.GetSourceScheme(r); forwardedScheme != "" { + secureTransport = forwardedScheme == "https" + } + args := map[string][]string{ "CurrentTime": {currTime.Format(time.RFC3339)}, "EpochTime": {strconv.FormatInt(currTime.Unix(), 10)}, - "SecureTransport": {strconv.FormatBool(r.TLS != nil)}, + "SecureTransport": {strconv.FormatBool(secureTransport)}, "SourceIp": {handlers.GetSourceIPRaw(r)}, "UserAgent": {r.UserAgent()}, "Referer": {r.Referer()},