diff --git a/spring-web/src/main/java/org/springframework/http/server/reactive/AbstractServerHttpRequest.java b/spring-web/src/main/java/org/springframework/http/server/reactive/AbstractServerHttpRequest.java index 527445c92e..3b8bb8ad70 100644 --- a/spring-web/src/main/java/org/springframework/http/server/reactive/AbstractServerHttpRequest.java +++ b/spring-web/src/main/java/org/springframework/http/server/reactive/AbstractServerHttpRequest.java @@ -69,7 +69,8 @@ public abstract class AbstractServerHttpRequest implements ServerHttpRequest { * Constructor with the URI and headers for the request. * @param uri the URI for the request * @param contextPath the context path for the request - * @param headers the headers for the request + * @param headers the headers for the request (as {@link MultiValueMap}) + * @since 5.3 */ public AbstractServerHttpRequest(URI uri, @Nullable String contextPath, MultiValueMap headers) { this.uri = uri; @@ -77,6 +78,18 @@ public abstract class AbstractServerHttpRequest implements ServerHttpRequest { this.headers = HttpHeaders.readOnlyHttpHeaders(headers); } + /** + * Constructor with the URI and headers for the request. + * @param uri the URI for the request + * @param contextPath the context path for the request + * @param headers the headers for the request (as {@link HttpHeaders}) + */ + public AbstractServerHttpRequest(URI uri, @Nullable String contextPath, HttpHeaders headers) { + this.uri = uri; + this.path = RequestPath.parse(uri, contextPath); + this.headers = HttpHeaders.readOnlyHttpHeaders(headers); + } + @Override public String getId() {