You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by re...@apache.org on 2026/06/12 17:51:41 UTC
(jackrabbit) branch JCR-5233 created (now e8c62650c)
This is an automated email from the ASF dual-hosted git repository.
reschke pushed a change to branch JCR-5233
in repository https://gitbox.apache.org/repos/asf/jackrabbit.git
at e8c62650c JCR-5233: commons-fileupload (1.6) restricts header size in upload parts - bump up the default and a system property knob
This branch includes the following new commits:
new e8c62650c JCR-5233: commons-fileupload (1.6) restricts header size in upload parts - bump up the default and a system property knob
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.
(jackrabbit) 01/01: JCR-5233: commons-fileupload (1.6) restricts header size in upload parts - bump up the default and a system property knob
Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
reschke pushed a commit to branch JCR-5233
in repository https://gitbox.apache.org/repos/asf/jackrabbit.git
commit e8c62650ce36bddbbcb429dc011199fb9c114499
Author: Julian Reschke <ju...@gmx.de>
AuthorDate: Fri Jun 12 18:51:22 2026 +0100
JCR-5233: commons-fileupload (1.6) restricts header size in upload parts - bump up the default and a system property knob
---
.../org/apache/jackrabbit/server/util/HttpMultipartPost.java | 3 +++
.../org/apache/jackrabbit/server/util/RequestDataTest.java | 12 ++++++------
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/util/HttpMultipartPost.java b/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/util/HttpMultipartPost.java
index ac9c44b29..9d71f38ba 100644
--- a/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/util/HttpMultipartPost.java
+++ b/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/util/HttpMultipartPost.java
@@ -69,6 +69,9 @@ class HttpMultipartPost {
ServletFileUpload upload = new ServletFileUpload(getFileItemFactory(tmpDir));
if (PARTHEADERSIZEMAX > 0) {
upload.setPartHeaderSizeMax(PARTHEADERSIZEMAX);
+ } else {
+ // override the default limit of 512 in commons-fileupload 1.6
+ upload.setPartHeaderSizeMax(4096);
}
// make sure the content disposition headers are read with the charset
// specified in the request content type (or UTF-8 if no charset is specified).
diff --git a/jackrabbit-jcr-server/src/test/java/org/apache/jackrabbit/server/util/RequestDataTest.java b/jackrabbit-jcr-server/src/test/java/org/apache/jackrabbit/server/util/RequestDataTest.java
index bb86153d1..0efe422fc 100755
--- a/jackrabbit-jcr-server/src/test/java/org/apache/jackrabbit/server/util/RequestDataTest.java
+++ b/jackrabbit-jcr-server/src/test/java/org/apache/jackrabbit/server/util/RequestDataTest.java
@@ -34,7 +34,6 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.*;
-
import javax.servlet.ServletInputStream;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -212,12 +211,13 @@ public class RequestDataTest {
@Test(expected=IOException.class)
public void testMultipartPostWithExtremelyLongFilename() throws Exception {
- buildRequestWithFilenameOfVaryingLength(1000);
+ // tests against the new default value of 4096
+ buildRequestWithFilenameOfVaryingLength(5000);
File testTmpDir = tempFolder.newFolder("jackrabbit_long_filename");
RequestData requestData = new RequestData(mockRequest, testTmpDir);
try {
assertTrue(
- requestData.getParameter("fileUpload").length() > 950);
+ requestData.getParameter("fileUpload").length() > 4900);
} finally {
requestData.dispose();
}
@@ -226,13 +226,13 @@ public class RequestDataTest {
@Test
public void testMultipartPostWithExtremelyLongFilenameNButHigherConfig() throws Exception {
try {
- System.setProperty("jackrabbit-server-PartHeaderSizeMax", "2048");
- buildRequestWithFilenameOfVaryingLength(1000);
+ System.setProperty("jackrabbit-server-PartHeaderSizeMax", "8192");
+ buildRequestWithFilenameOfVaryingLength(7500);
File testTmpDir = tempFolder.newFolder("jackrabbit_long_filename");
RequestData requestData = new RequestData(mockRequest, testTmpDir);
try {
assertTrue(
- requestData.getParameter("fileUpload").length() > 950);
+ requestData.getParameter("fileUpload").length() > 7500);
} finally {
requestData.dispose();
}