ASF Bugzilla – Attachment 37199 Details for
Bug 64384
<multipart-config> is ignored if any of max-file-size/max-request-size/file-threshold-size elements are missing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
file_64384.txt (text/plain), 2.26 KB, created by
Christopher Schultz
on 2020-04-27 16:46:01 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Christopher Schultz
Created:
2020-04-27 16:46:01 UTC
Size:
2.26 KB
patch
obsolete
>diff --git a/java/org/apache/catalina/startup/ContextConfig.java b/java/org/apache/catalina/startup/ContextConfig.java >index fe8c87d..0f29773 100644 >--- a/java/org/apache/catalina/startup/ContextConfig.java >+++ b/java/org/apache/catalina/startup/ContextConfig.java >@@ -1354,19 +1354,25 @@ > wrapper.setServletClass(servlet.getServletClass()); > MultipartDef multipartdef = servlet.getMultipartDef(); > if (multipartdef != null) { >- if (multipartdef.getMaxFileSize() != null && >- multipartdef.getMaxRequestSize()!= null && >- multipartdef.getFileSizeThreshold() != null) { >- wrapper.setMultipartConfigElement(new MultipartConfigElement( >- multipartdef.getLocation(), >- Long.parseLong(multipartdef.getMaxFileSize()), >- Long.parseLong(multipartdef.getMaxRequestSize()), >- Integer.parseInt( >- multipartdef.getFileSizeThreshold()))); >- } else { >- wrapper.setMultipartConfigElement(new MultipartConfigElement( >- multipartdef.getLocation())); >+ long maxFileSize = -1; >+ long maxRequestSize = -1; >+ int fileSizeThreshold = 0; >+ >+ if(null != multipartdef.getMaxFileSize()) { >+ maxFileSize = Long.parseLong(multipartdef.getMaxFileSize()); > } >+ if(null != multipartdef.getMaxRequestSize()) { >+ maxRequestSize = Long.parseLong(multipartdef.getMaxRequestSize()); >+ } >+ if(null != multipartdef.getFileSizeThreshold()) { >+ fileSizeThreshold = Integer.parseInt(multipartdef.getFileSizeThreshold()); >+ } >+ >+ wrapper.setMultipartConfigElement(new MultipartConfigElement( >+ multipartdef.getLocation(), >+ maxFileSize, >+ maxRequestSize, >+ fileSizeThreshold)); > } > if (servlet.getAsyncSupported() != null) { > wrapper.setAsyncSupported(
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 64384
:
37198
| 37199