Skip to content

Commit 7db77e9

Browse files
committed
Update version.
Allow the default max size for form config to be removed so that it is possible to use a single max body size.
1 parent 6838ffa commit 7db77e9

File tree

6 files changed

+13
-14
lines changed

6 files changed

+13
-14
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### Latest versions
44

5-
* Latest stable version: `1.2.0`
5+
* Latest stable version: `1.3.0`
66
* Now with 100% more virtual threads!
77
* Prior stable version `0.3.7`
88

@@ -27,20 +27,20 @@ To add this library to your project, you can include this dependency in your Mav
2727
<dependency>
2828
<groupId>io.fusionauth</groupId>
2929
<artifactId>java-http</artifactId>
30-
<version>1.2.0</version>
30+
<version>1.3.0</version>
3131
</dependency>
3232
```
3333

3434
If you are using Gradle, you can add this to your build file:
3535

3636
```groovy
37-
implementation 'io.fusionauth:java-http:1.2.0'
37+
implementation 'io.fusionauth:java-http:1.3.0'
3838
```
3939

4040
If you are using Savant, you can add this to your build file:
4141

4242
```groovy
43-
dependency(id: "io.fusionauth:java-http:1.2.0")
43+
dependency(id: "io.fusionauth:java-http:1.3.0")
4444
```
4545

4646
## Examples Usages:

build.savant

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ restifyVersion = "4.2.1"
1818
slf4jVersion = "2.0.17"
1919
testngVersion = "7.11.0"
2020

21-
project(group: "io.fusionauth", name: "java-http", version: "1.2.0", licenses: ["ApacheV2_0"]) {
21+
project(group: "io.fusionauth", name: "java-http", version: "1.3.0", licenses: ["ApacheV2_0"]) {
2222
workflow {
2323
fetch {
2424
// Dependency resolution order:

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>io.fusionauth</groupId>
44
<artifactId>java-http</artifactId>
5-
<version>1.2.0</version>
5+
<version>1.3.0</version>
66
<packaging>jar</packaging>
77

88
<name>Java HTTP library (client and server)</name>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ default T withMaxPendingSocketConnections(int maxPendingSocketConnections) {
201201
* <li>*</li>
202202
* </ol>
203203
* <p>
204-
* If the provided configuration does not contain the initial default values for "*" and "application/x-www-form-urlencoded", the
205-
* server default values will be retained.
204+
* If the provided configuration does not contain the initial default identified by the "*" key, the server default value will be retained.
206205
* key.
207206
* <p>
208207
* Set any value to -1 to disable this limitation.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,9 @@ public HTTPServerConfiguration withMaxRequestBodySize(Map<String, Integer> maxRe
490490
}
491491
}
492492

493-
// This preserves the default values in the field definition if the incoming Map does not contain them. Otherwise, they are overridden
494493
this.maxRequestBodySize.clear();
495-
this.maxRequestBodySize.putAll(DefaultMaxRequestSizes);
494+
// Add back a default to ensure we always have a fallback, can still be modified by the incoming configuration.
495+
this.maxRequestBodySize.put("*", DefaultMaxRequestSizes.get("*"));
496496
this.maxRequestBodySize.putAll(maxRequestBodySize);
497497
return this;
498498
}

src/test/java/io/fusionauth/http/FormDataTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void post_server_configuration_max_form_data(String scheme, boolean chunk
7474
// Exceeded
7575
withScheme(scheme)
7676
.withChunked(chunked)
77-
.withBodyParameterCount(42 * 1024) // 43,008
77+
.withBodyParameterCount(42 * 1024)
7878
.withBodyParameterSize(128)
7979
// 4k * 33 > 128k
8080
.withConfiguration(config -> config.withMaxRequestBodySize(Map.of(ContentTypes.Form, 128 * 1024)))
@@ -89,7 +89,7 @@ public void post_server_configuration_max_form_data(String scheme, boolean chunk
8989
// Large, but max size has been disabled
9090
withScheme(scheme)
9191
.withChunked(chunked)
92-
.withBodyParameterCount(42 * 1024) // 43,008
92+
.withBodyParameterCount(42 * 1024)
9393
.withBodyParameterSize(128)
9494
// Disable the limit
9595
.withConfiguration(config -> config.withMaxRequestBodySize(Map.of(ContentTypes.Form, -1)))
@@ -105,9 +105,9 @@ public void post_server_configuration_max_form_data(String scheme, boolean chunk
105105
// Large, enforce using default w/out a specific configuration for application/x-www-form-urlencoded
106106
withScheme(scheme)
107107
.withChunked(chunked)
108-
.withBodyParameterCount(42 * 1024) // 131,072, 131,072
108+
.withBodyParameterCount(42 * 1024)
109109
.withBodyParameterSize(128)
110-
// Disable the limit
110+
// Remove the limit for form data, and fall back to the global
111111
.withConfiguration(config -> config.withMaxRequestBodySize(Map.of("*", 128 * 1024)))
112112
.expectResponse("""
113113
HTTP/1.1 413 \r

0 commit comments

Comments
 (0)