api: xmlDecoder should honor contentLength. (#2226)

This is needed so that we avoid reading large amounts
of data from compromised clients.
This commit is contained in:
Harshavardhana
2016-07-18 21:20:17 -07:00
committed by GitHub
parent 5cc9e4e214
commit 1f706e067d
4 changed files with 68 additions and 37 deletions
+3 -4
View File
@@ -322,10 +322,9 @@ func (api objectAPIHandlers) PutBucketHandler(w http.ResponseWriter, r *http.Req
}
}
// the location value in the request body should match the Region in serverConfig.
// other values of location are not accepted.
// make bucket fails in such cases.
errCode := isValidLocationContraint(r.Body, serverConfig.GetRegion())
// Validate if incoming location constraint is valid, reject
// requests which do not follow valid region requirements.
errCode := isValidLocationConstraint(r)
if errCode != ErrNone {
writeErrorResponse(w, r, errCode, r.URL.Path)
return