preserve incoming query params in success_action_redirect (#15280)

fixes #15274
This commit is contained in:
Harshavardhana
2022-07-13 07:46:44 -07:00
committed by GitHub
parent 996cac5fed
commit 788fd3df81
3 changed files with 8 additions and 16 deletions

View File

@@ -1116,9 +1116,10 @@ func (api objectAPIHandlers) PostPolicyBucketHandler(w http.ResponseWriter, r *h
Host: handlers.GetSourceIP(r),
})
if successRedirect != "" {
// Replace raw query params..
redirectURL.RawQuery = getRedirectPostRawQuery(objInfo)
if redirectURL != nil { // success_action_redirect is valid and set.
redirectURL.Query().Add("bucket", objInfo.Bucket)
redirectURL.Query().Add("key", objInfo.Name)
redirectURL.Query().Add("etag", "\""+objInfo.ETag+"\"")
writeRedirectSeeOther(w, redirectURL.String())
return
}