[#316] Return badrequest err if couldnt parse body

Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
Angira Kekteeva 2022-01-19 23:20:07 +03:00 committed by Alex Vanin
parent 3307953a4c
commit e5a256df0c
3 changed files with 4 additions and 4 deletions

View file

@ -612,7 +612,7 @@ func parseLocationConstraint(r *http.Request) (*createBucketParams, error) {
params := new(createBucketParams)
if err := xml.NewDecoder(r.Body).Decode(params); err != nil {
return nil, err
return nil, errors.GetAPIError(errors.ErrMalformedXML)
}
return params, nil
}