sreejasahithi commented on code in PR #12094:
URL: https://github.com/apache/ozone/pull/12094#discussion_r4625797710
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/MultiDeleteRequestUnmarshaller.java:
##########
@@ -35,4 +44,20 @@ public MultiDeleteRequestUnmarshaller() {
super(MultiDeleteRequest.class);
}
+ @Override
+ public MultiDeleteRequest readFrom(Class<MultiDeleteRequest> clazz, Type
type, Annotation[] annotations,
+ MediaType mediaType, MultivaluedMap<String, String> httpHeaders,
InputStream inputStream)
+ throws WebApplicationException {
+ final byte[] body;
+ try {
+ body = IOUtils.toByteArray(inputStream);
+ } catch (IOException ex) {
+ throw new WebApplicationException(ex);
+ }
+ MultiDeleteRequest request = super.readFrom(clazz, type, annotations,
mediaType, httpHeaders,
+ new ByteArrayInputStream(body));
+ request.setBodyContentMD5(DigestUtils.md5Hex(body));
+ return request;
+ }
Review Comment:
In the new MultiDeleteRequestUnmarshaller.readFrom override, the body read
failure is wrapped in a plain WebApplicationException.
This maps to a 500 with no S3 XML error body. Previously this class
inherited MessageUnmarshaller.readFrom, where any failure is routed through
wrapOS3Exception(newError(INVALID_REQUEST, e)) -> 400 + a well-formed S3 error.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]