Skip to content

Update Dependency: commons-fileupload2-jakarta-servlet6 to 2.0.0-M4 #1465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 18, 2025

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.

Sorry, something went wrong.

@vicheey vicheey marked this pull request as ready for review June 17, 2025 23:03
@vicheey vicheey requested review from valerena and Vandita2020 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
Collaborator

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
Collaborator

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 and others added 3 commits June 18, 2025 06:52
@vicheey vicheey requested a review from deki June 18, 2025 16:31
vicheey added 2 commits June 18, 2025 09:48
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.

None yet

3 participants