Expose RequestPath in ServerHttpRequest

The new structured getPath() method replaces the existing
getContextPath() + getPathWithinApplication().

Issue: SPR-15648
This commit is contained in:
Rossen Stoyanchev
2017-06-11 21:57:54 -04:00
parent 2d17411ec4
commit 38a12ed4ba
26 changed files with 127 additions and 115 deletions

View File

@@ -56,8 +56,6 @@ public class MockServerHttpRequest extends AbstractServerHttpRequest {
private final HttpMethod httpMethod;
private final String contextPath;
private final MultiValueMap<String, HttpCookie> cookies;
private final InetSocketAddress remoteAddress;
@@ -70,9 +68,8 @@ public class MockServerHttpRequest extends AbstractServerHttpRequest {
InetSocketAddress remoteAddress,
Publisher<? extends DataBuffer> body) {
super(uri, headers);
super(uri, contextPath, headers);
this.httpMethod = httpMethod;
this.contextPath = contextPath;
this.cookies = cookies;
this.remoteAddress = remoteAddress;
this.body = Flux.from(body);
@@ -89,11 +86,6 @@ public class MockServerHttpRequest extends AbstractServerHttpRequest {
return this.httpMethod.name();
}
@Override
public String getContextPath() {
return this.contextPath;
}
@Override
public InetSocketAddress getRemoteAddress() {
return this.remoteAddress;