From 73e1f24ac17eb39a361ba90f0490f3e7eafe38ba Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 25 Nov 2020 11:36:12 +0100 Subject: [PATCH] Restore HttpHeaders-based constructor for binary compatibility Closes gh-26151 --- .../reactive/AbstractServerHttpRequest.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 527445c92eb..3b8bb8ad704 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() {