Encapsulate choice of URI encoding within RequestPath

Currently the URI path is always treated as UTF-8 so we can eliminate
the encoding parameter from RequestPath#parse.
This commit is contained in:
Rossen Stoyanchev
2017-07-10 14:55:01 +02:00
parent 122ee3096c
commit 9f7d57f933
8 changed files with 17 additions and 22 deletions

View File

@@ -19,7 +19,6 @@ package org.springframework.mock.web.reactive.function.server;
import java.net.InetSocketAddress;
import java.net.URI;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.Principal;
import java.util.Arrays;
import java.util.Collections;
@@ -92,7 +91,7 @@ public class MockServerRequest implements ServerRequest {
this.method = method;
this.uri = uri;
this.pathContainer = RequestPath.create(uri, contextPath, StandardCharsets.UTF_8);
this.pathContainer = RequestPath.parse(uri, contextPath);
this.headers = headers;
this.cookies = cookies;
this.body = body;