mirror of
https://github.com/minio/minio.git
synced 2025-11-21 02:09:08 -05:00
Return proper errors for invalid bodies (#7179)
This commit is contained in:
committed by
kannappanr
parent
36dae04671
commit
432aec73d9
@@ -40,7 +40,7 @@ func parseLocationConstraint(r *http.Request) (location string, s3Error APIError
|
||||
// be created at default region.
|
||||
locationConstraint := createBucketLocationConfiguration{}
|
||||
err := xmlDecoder(r.Body, &locationConstraint, r.ContentLength)
|
||||
if err != nil && err != io.EOF {
|
||||
if err != nil && r.ContentLength != 0 {
|
||||
logger.LogIf(context.Background(), err)
|
||||
// Treat all other failures as XML parsing errors.
|
||||
return "", ErrMalformedXML
|
||||
|
||||
Reference in New Issue
Block a user