|
|
|
@ -24,6 +24,7 @@ import ( |
|
|
|
|
"net/http" |
|
|
|
|
"net/url" |
|
|
|
|
"path" |
|
|
|
|
"path/filepath" |
|
|
|
|
"reflect" |
|
|
|
|
"strings" |
|
|
|
|
"sync" |
|
|
|
@ -438,7 +439,6 @@ func (api objectAPIHandlers) PostPolicyBucketHandler(w http.ResponseWriter, r *h |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Make sure that the URL does not contain object name.
|
|
|
|
|
bucket := mux.Vars(r)["bucket"] |
|
|
|
|
|
|
|
|
|
// Require Content-Length to be set in the request
|
|
|
|
@ -447,6 +447,16 @@ func (api objectAPIHandlers) PostPolicyBucketHandler(w http.ResponseWriter, r *h |
|
|
|
|
writeErrorResponse(w, ErrMissingContentLength, r.URL) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
resource, err := getResource(r.URL.Path, r.Host, globalDomainName) |
|
|
|
|
if err != nil { |
|
|
|
|
writeErrorResponse(w, ErrInvalidRequest, r.URL) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
// Make sure that the URL does not contain object name.
|
|
|
|
|
if bucket != filepath.Clean(resource[1:]) { |
|
|
|
|
writeErrorResponse(w, ErrMethodNotAllowed, r.URL) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Here the parameter is the size of the form data that should
|
|
|
|
|
// be loaded in memory, the remaining being put in temporary files.
|
|
|
|
|