-
Notifications
You must be signed in to change notification settings - Fork 566
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
Changes from 3 commits
cc0e127
29072d3
db4aaa0
8b7e7ff
d7d4b9d
2939512
829b484
b8d7cb7
1011155
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -493,7 +493,7 @@ public Part getPart(String s) | |
} | ||
|
||
@SuppressFBWarnings({"FILE_UPLOAD_FILENAME", "WEAK_FILENAMEUTILS"}) | ||
protected Map<String, List<Part>> getMultipartFormParametersMap() { | ||
protected Map<String, List<Part>> getMultipartFormParametersMap() throws RuntimeException { | ||
if (multipartFormParameters != null) { | ||
return multipartFormParameters; | ||
} | ||
|
@@ -511,16 +511,20 @@ protected Map<String, List<Part>> getMultipartFormParametersMap() { | |
List<DiskFileItem> items = upload.parseRequest(this); | ||
for (FileItem<DiskFileItem> item : items) { | ||
String fileName = FilenameUtils.getName(item.getName()); | ||
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); | ||
try { | ||
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); | ||
} catch (IOException e) { | ||
log.error("Encounter issue adding form multipart", e); | ||
throw new RuntimeException(e); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
Therefore I wouldn't make it a generic There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. Thank you. Since There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. You can even remove the try/ catch block. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Of course. |
||
} | ||
} | ||
} catch (FileUploadException e) { | ||
Timer.stop("SERVLET_REQUEST_GET_MULTIPART_PARAMS"); | ||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.