Fix missing contextPath when mutating ServerHttpRequest
This commit ensures that when mutating `ServerHttpRequest` instances, the original contextPath information is copied to the request being built. Note that mutation on the `contextPath(String)` or `path(String)` should be reflected to the other. (See their Javadoc for more information). Fixes gh-25279
This commit is contained in:
@@ -71,6 +71,7 @@ class DefaultServerHttpRequestBuilder implements ServerHttpRequest.Builder {
|
||||
|
||||
this.uri = original.getURI();
|
||||
this.httpMethodValue = original.getMethodValue();
|
||||
this.contextPath = original.getPath().contextPath().value();
|
||||
this.body = original.getBody();
|
||||
|
||||
this.httpHeaders = HttpHeaders.writableHttpHeaders(original.getHeaders());
|
||||
|
||||
Reference in New Issue
Block a user