You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
privateintmaxFormDataSize = 10 * 1024 * 1024; // 10 Megabytes, ideally same as MultipartConfiguration.maxRequestSize default
59
-
60
60
privateintmaxPendingSocketConnections = 250;
61
61
62
-
privateintmaxRequestBodySize = 128 * 1024 * 1024; // 128 Megabytes, must be equal to or larger than maxFormDataSize, and MultipartConfiguration.maxRequestSize
Objects.requireNonNull(maxSize, "You may not specify a null value for the maximum request body size");
485
+
if (maxSize != -1 && maxSize <= 0) {
486
+
thrownewIllegalArgumentException("The maximum request body size must be greater than 0 for [" + contentType + "]. Set to -1 to disable this limitation.");
// RFC 1341 indicates subtypes cannot be nested. So if we do not yet have a match, use the default key '*'.
74
+
returnmaximumSize != null
75
+
? maximumSize
76
+
: maxRequestBodySize.get("*");
77
+
}
78
+
48
79
/**
49
80
* Statically sets up the logger, mostly for trace logging.
50
81
*
@@ -343,7 +374,7 @@ public static void parseRequestPreamble(PushbackInputStream inputStream, int max
343
374
344
375
// index is the number of bytes we processed as part of the preamble
345
376
premableLength += index;
346
-
if (maxRequestHeaderSize !=-1 && premableLength > maxRequestHeaderSize) {
377
+
if (maxRequestHeaderSize !=-1 && premableLength > maxRequestHeaderSize) {
347
378
thrownewRequestHeadersTooLargeException(maxRequestHeaderSize, "The maximum size of the request header has been exceeded. The maximum size is [" + maxRequestHeaderSize + "] bytes.");
0 commit comments