From b9f5f9ba3f5d708937be9061e682573ae38075ff Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Fri, 10 Feb 2023 18:59:10 +0800 Subject: [PATCH] fix: aclHandlers convert XML parse error to relevant client error (#16587) --- cmd/acl-handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/acl-handlers.go b/cmd/acl-handlers.go index ada37e3d9..74ed02843 100644 --- a/cmd/acl-handlers.go +++ b/cmd/acl-handlers.go @@ -90,7 +90,7 @@ func (api objectAPIHandlers) PutBucketACLHandler(w http.ResponseWriter, r *http. if aclHeader == "" { acl := &accessControlPolicy{} if err = xmlDecoder(r.Body, acl, r.ContentLength); err != nil { - if err == io.EOF { + if terr, ok := err.(*xml.SyntaxError); ok && terr.Msg == io.EOF.Error() { writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrMissingSecurityHeader), r.URL) return