Print certain log messages once per error (#17484)

This commit is contained in:
Kaan Kabalak
2023-06-24 20:29:13 -07:00
committed by GitHub
parent 1f8b9b4bd5
commit 21fbe88e1f
15 changed files with 31 additions and 31 deletions

View File

@@ -48,7 +48,7 @@ func parseLocationConstraint(r *http.Request) (location string, s3Error APIError
locationConstraint := createBucketLocationConfiguration{}
err := xmlDecoder(r.Body, &locationConstraint, r.ContentLength)
if err != nil && r.ContentLength != 0 {
logger.LogIf(GlobalContext, err)
logger.LogOnceIf(GlobalContext, err, "location-constraint-xml-parsing")
// Treat all other failures as XML parsing errors.
return "", ErrMalformedXML
} // else for both err as nil or io.EOF