Skip to content

Conversation

@vicheey
Copy link
Contributor

@vicheey vicheey commented Jun 17, 2025

This is to update dependency on commons-fileupload2-core from 2.0.0-M2 to 2.0.0-M4

By submitting this pull request

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I confirm that I've made the best effort attempt to update all relevant documentation.

@vicheey vicheey marked this pull request as ready for review June 17, 2025 23:03
@vicheey vicheey requested review from Vandita2020 and valerena June 17, 2025 23:03
vicheey added 2 commits June 17, 2025 16:31
This is to update dependency on commons-fileupload2-core from 2.0.0-M2 to 2.0.0-M4
…/serverless/proxy/internal/servlet/AwsHttpServletRequest.java
addPart(multipartFormParameters, item.getFieldName(), newPart);
} catch (IOException e) {
log.error("Encounter issue adding form multipart", e);
throw new RuntimeException(e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see https://javadoc.io/static/jakarta.servlet/jakarta.servlet-api/6.0.0/jakarta.servlet/jakarta/servlet/http/HttpServletRequest.html#getPart(java.lang.String) and https://javadoc.io/doc/jakarta.servlet/jakarta.servlet-api/6.0.0/jakarta.servlet/jakarta/servlet/http/HttpServletRequest.html:

IOException - if an I/O error occurred during the retrieval of the Part components of this request
ServletException - if this request is not of type multipart/form-data
IllegalStateException - if the request body is larger than maxRequestSize, or any Part in the request is larger than maxFileSize, or there is no @MultipartConfig or multipart-config in deployment descriptors

Therefore I wouldn't make it a generic RuntimeException here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thank you. Since getMultipartFormParametersMap() used in getParts() which throw IOException, ServletException in its signature, i updated the code to just throw IOException from getMultipartFormParametersMap()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. You can even remove the try/ catch block.

Copy link
Contributor Author

@vicheey vicheey Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course.

@vicheey vicheey requested a review from deki June 18, 2025 16:31
Comment on lines 514 to 522
AwsProxyRequestPart newPart = new AwsProxyRequestPart(item.get());
newPart.setName(item.getFieldName());
newPart.setSubmittedFileName(fileName);
newPart.setContentType(item.getContentType());
newPart.setSize(item.getSize());
item.getHeaders().getHeaderNames().forEachRemaining(h -> {
newPart.addHeader(h, item.getHeaders().getHeader(h));
});
addPart(multipartFormParameters, item.getFieldName(), newPart);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go back to original indentation here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It was not highlighted locally. Removing extra space.

@vicheey vicheey requested a review from valerena June 18, 2025 20:18
@vicheey vicheey merged commit 0102ec2 into aws:main Jun 18, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants