mirror of
https://github.com/pgsty/minio.git
synced 2026-07-21 13:10:22 +03:00
URL Encode X-Amz-Copy-Source as per the spec (#2114)
The documents for COPY state that the X-Amz-Copy-Source must be URL encoded. http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectCOPY.html
This commit is contained in:
committed by
Harshavardhana
parent
a51bb1d728
commit
8c767218a4
+6
-3
@@ -337,11 +337,14 @@ func (api objectAPIHandlers) CopyObjectHandler(w http.ResponseWriter, r *http.Re
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Reject requests where body/payload is present, for now we
|
||||
// don't even read it.
|
||||
// TODO: Reject requests where body/payload is present, for now we don't even read it.
|
||||
|
||||
// objectSource
|
||||
objectSource := r.Header.Get("X-Amz-Copy-Source")
|
||||
objectSource, err := url.QueryUnescape(r.Header.Get("X-Amz-Copy-Source"))
|
||||
if err != nil {
|
||||
// Save unescaped string as is.
|
||||
objectSource = r.Header.Get("X-Amz-Copy-Source")
|
||||
}
|
||||
|
||||
// Skip the first element if it is '/', split the rest.
|
||||
if strings.HasPrefix(objectSource, "/") {
|
||||
|
||||
Reference in New Issue
Block a user