fix forgotten domain in parameter builder

This commit is contained in:
Jörg Prante 2023-08-08 17:13:34 +02:00
parent 9287e6c36a
commit 9c551e3c34
3 changed files with 9 additions and 5 deletions

View file

@ -1,5 +1,5 @@
group = org.xbib
name = net-http
version = 3.6.0
version = 3.6.1
org.gradle.warning.mode = ALL

View file

@ -209,13 +209,16 @@ public class BaseHttpRouter implements HttpRouter {
if (mimeType != null) {
charset = getCharset(mimeType, charset);
}
ParameterBuilder parameterBuilder = Parameter.builder().charset(charset);
ParameterBuilder parameterBuilder = Parameter.builder()
.domain(Parameter.Domain.QUERY)
.charset(charset);
// helper URL to collect parameters in request URI
URL url = URL.builder()
.charset(charset, CodingErrorAction.REPLACE)
.path(httpRequestBuilder.getRequestURI())
.build();
ParameterBuilder formParameterBuilder = Parameter.builder().domain(Parameter.Domain.FORM)
ParameterBuilder formParameterBuilder = Parameter.builder()
.domain(Parameter.Domain.FORM)
.enableDuplicates();
// https://www.w3.org/TR/html4/interact/forms.html#h-17.13.4
if (HttpMethod.POST.equals(httpRequestBuilder.getMethod()) &&
@ -243,7 +246,8 @@ public class BaseHttpRouter implements HttpRouter {
}
}
CookieBox cookieBox = httpRouterContext.getAttributes().get(CookieBox.class, "incomingcookies");
ParameterBuilder cookieParameterBuilder = Parameter.builder().domain(Parameter.Domain.COOKIE);
ParameterBuilder cookieParameterBuilder = Parameter.builder()
.domain(Parameter.Domain.COOKIE);
if (cookieBox != null) {
cookieBox.forEach(c -> cookieParameterBuilder.add(c.name(), c.value()));
}

View file

@ -8,7 +8,7 @@ dependencyResolutionManagement {
version('netty-tcnative', '2.0.61.Final')
version('datastructures', '2.3.0')
version('config', '5.0.3')
version('net', '3.3.0')
version('net', '3.3.3')
library('junit-jupiter-api', 'org.junit.jupiter', 'junit-jupiter-api').versionRef('junit')
library('junit-jupiter-params', 'org.junit.jupiter', 'junit-jupiter-params').versionRef('junit')
library('junit-jupiter-engine', 'org.junit.jupiter', 'junit-jupiter-engine').versionRef('junit')