You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by re...@apache.org on 2025/05/11 01:14:42 UTC
(wicket) branch reiern70/WICKET-7154 created (now 8dcaafec3c)
This is an automated email from the ASF dual-hosted git repository.
reiern70 pushed a change to branch reiern70/WICKET-7154
in repository https://gitbox.apache.org/repos/asf/wicket.git
at 8dcaafec3c [WICKET-7154] use getQueryParameters to avoid tomcat parsing the multipart request before we create MultipartServletWebRequest.
This branch includes the following new commits:
new 8dcaafec3c [WICKET-7154] use getQueryParameters to avoid tomcat parsing the multipart request before we create MultipartServletWebRequest.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(wicket) 01/01: [WICKET-7154] use getQueryParameters to avoid tomcat parsing the multipart request before we create MultipartServletWebRequest.
Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
reiern70 pushed a commit to branch reiern70/WICKET-7154
in repository https://gitbox.apache.org/repos/asf/wicket.git
commit 8dcaafec3c6952476637b9252544be7e404a0d3c
Author: reiern70 <re...@gmail.com>
AuthorDate: Sat May 10 20:14:07 2025 -0500
[WICKET-7154] use getQueryParameters to avoid tomcat parsing the multipart request before we create MultipartServletWebRequest.
---
.../resource/AbstractFileUploadResource.java | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/upload/resource/AbstractFileUploadResource.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/upload/resource/AbstractFileUploadResource.java
index eaf4af213c..db41c1cb40 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/upload/resource/AbstractFileUploadResource.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/upload/resource/AbstractFileUploadResource.java
@@ -94,7 +94,7 @@ public abstract class AbstractFileUploadResource extends AbstractResource
final ServletWebRequest webRequest = (ServletWebRequest) attributes.getRequest();
// get the ID of the upload field (it should be unique per application)
- String uploadId = webRequest.getRequestParameters().getParameterValue(UPLOAD_ID).toString("resource");
+ String uploadId = getUploadId(webRequest);
Bytes maxSize = getMaxSize(webRequest);
Bytes fileMaxSize = getFileMaxSize(webRequest);
@@ -253,7 +253,8 @@ public abstract class AbstractFileUploadResource extends AbstractResource
{
try
{
- return Bytes.bytes(webRequest.getRequestParameters().getParameterValue("maxSize").toLong());
+ // WICKET-7154 we need to avoid reading POST parameters
+ return Bytes.bytes(webRequest.getQueryParameters().getParameterValue("maxSize").toLong());
}
catch (StringValueConversionException e)
{
@@ -269,10 +270,22 @@ public abstract class AbstractFileUploadResource extends AbstractResource
*/
private Bytes getFileMaxSize(ServletWebRequest webRequest)
{
- long fileMaxSize = webRequest.getRequestParameters().getParameterValue("fileMaxSize").toLong(-1);
+ // WICKET-7154 we need to avoid reading POST parameters
+ long fileMaxSize = webRequest.getQueryParameters().getParameterValue("fileMaxSize").toLong(-1);
return fileMaxSize > 0 ? Bytes.bytes(fileMaxSize) : null;
}
+ /**
+ * Defines what is the maximum size of an uploaded file.
+ *
+ * @return Bytes
+ */
+ private String getUploadId(ServletWebRequest webRequest)
+ {
+ // WICKET-7154 we need to avoid reading POST parameters
+ return webRequest.getQueryParameters().getParameterValue(UPLOAD_ID).toString("upload");
+ }
+
/**
* Defines what is the maximum size of an uploaded file.
*
@@ -280,7 +293,8 @@ public abstract class AbstractFileUploadResource extends AbstractResource
*/
private long getFileCountMax(ServletWebRequest webRequest)
{
- return webRequest.getRequestParameters().getParameterValue("fileCountMax").toLong(-1);
+ // WICKET-7154 we need to avoid reading POST parameters
+ return webRequest.getQueryParameters().getParameterValue("fileCountMax").toLong(-1);
}
/**