mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
copy query values before update to preserve the expected keys (#15310)
in success_action_redirect we were missing required query params as per S3 spec - updated tests.
This commit is contained in:
parent
785b429737
commit
1cd6713e24
@ -1117,9 +1117,11 @@ func (api objectAPIHandlers) PostPolicyBucketHandler(w http.ResponseWriter, r *h
|
|||||||
})
|
})
|
||||||
|
|
||||||
if redirectURL != nil { // success_action_redirect is valid and set.
|
if redirectURL != nil { // success_action_redirect is valid and set.
|
||||||
redirectURL.Query().Add("bucket", objInfo.Bucket)
|
v := redirectURL.Query()
|
||||||
redirectURL.Query().Add("key", objInfo.Name)
|
v.Add("bucket", objInfo.Bucket)
|
||||||
redirectURL.Query().Add("etag", "\""+objInfo.ETag+"\"")
|
v.Add("key", objInfo.Name)
|
||||||
|
v.Add("etag", "\""+objInfo.ETag+"\"")
|
||||||
|
redirectURL.RawQuery = v.Encode()
|
||||||
writeRedirectSeeOther(w, redirectURL.String())
|
writeRedirectSeeOther(w, redirectURL.String())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -499,9 +499,11 @@ func testPostPolicyBucketHandlerRedirect(obj ObjectLayer, instanceType string, t
|
|||||||
t.Error("Unexpected error: ", err)
|
t.Error("Unexpected error: ", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
redirectURL.Query().Add("bucket", info.Bucket)
|
v := redirectURL.Query()
|
||||||
redirectURL.Query().Add("key", info.Name)
|
v.Add("bucket", info.Bucket)
|
||||||
redirectURL.Query().Add("etag", "\""+info.ETag+"\"")
|
v.Add("key", info.Name)
|
||||||
|
v.Add("etag", "\""+info.ETag+"\"")
|
||||||
|
redirectURL.RawQuery = v.Encode()
|
||||||
expectedLocation := redirectURL.String()
|
expectedLocation := redirectURL.String()
|
||||||
|
|
||||||
// Check the new location url
|
// Check the new location url
|
||||||
|
Loading…
Reference in New Issue
Block a user