Skip to content

Commit a2a49f8

Browse files
committed
Working
1 parent 1ca9e2c commit a2a49f8

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/main/java/io/fusionauth/http/server/HTTPServer.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,16 @@ public HTTPServer start() {
8383
return this;
8484
}
8585

86-
// Validate inter-dependant configuration options.
86+
// On server start-up, validate inter-dependant configuration options.
8787
int maxRequestBodySize = configuration.getMaxRequestBodySize();
8888
int maxFormDataSize = configuration.getMaxFormDataSize();
8989
long maxMultipartRequestSize = configuration.getMultipartConfiguration().getMaxRequestSize();
90-
if (maxRequestBodySize < maxFormDataSize || maxRequestBodySize < maxMultipartRequestSize) {
91-
logger.error("Unable to start the HTTP server because the configuration is invalid. The [maxRequestBodySize] configuration is intended as a fail-safe, and must be greater than or equal to [maxFormDataSize] and [multipartStreamConfiguration.maxRequestSize].");
92-
return this;
90+
if (maxRequestBodySize != -1) {
91+
// The user may disable maxFormDataSize or maxMultipartRequestSize by setting them to -1, that is ok. In this case, maxRequestBodySize will still be enforced.
92+
if (maxRequestBodySize < maxFormDataSize || maxRequestBodySize < maxMultipartRequestSize ) {
93+
logger.error("Unable to start the HTTP server because the configuration is invalid. The [maxRequestBodySize] configuration is intended as a fail-safe, and must be greater than or equal to [maxFormDataSize] and [multipartStreamConfiguration.maxRequestSize].");
94+
return this;
95+
}
9396
}
9497

9598
// Set up the server logger and the static loggers

src/main/java/io/fusionauth/http/server/io/HTTPInputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public int read(byte[] b, int off, int len) throws IOException {
174174
// - This will handle all requests that are not fixed length.
175175
if (maximumContentLength != -1) {
176176
if (bytesRead > maximumContentLength) {
177-
String detailedMessage = "The maximum request size has been exceeded.The maximum request size is [" + maximumContentLength + "] bytes.";
177+
String detailedMessage = "The maximum request size has been exceeded. The maximum request size is [" + maximumContentLength + "] bytes.";
178178
throw new ContentTooLargeException(maximumContentLength, detailedMessage);
179179
}
180180
}

0 commit comments

Comments
 (0)