Skip to content

Commit 73e1f24

Browse files
committed
Restore HttpHeaders-based constructor for binary compatibility
Closes gh-26151
1 parent 86f9716 commit 73e1f24

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

spring-web/src/main/java/org/springframework/http/server/reactive/AbstractServerHttpRequest.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,27 @@ public abstract class AbstractServerHttpRequest implements ServerHttpRequest {
6969
* Constructor with the URI and headers for the request.
7070
* @param uri the URI for the request
7171
* @param contextPath the context path for the request
72-
* @param headers the headers for the request
72+
* @param headers the headers for the request (as {@link MultiValueMap})
73+
* @since 5.3
7374
*/
7475
public AbstractServerHttpRequest(URI uri, @Nullable String contextPath, MultiValueMap<String, String> headers) {
7576
this.uri = uri;
7677
this.path = RequestPath.parse(uri, contextPath);
7778
this.headers = HttpHeaders.readOnlyHttpHeaders(headers);
7879
}
7980

81+
/**
82+
* Constructor with the URI and headers for the request.
83+
* @param uri the URI for the request
84+
* @param contextPath the context path for the request
85+
* @param headers the headers for the request (as {@link HttpHeaders})
86+
*/
87+
public AbstractServerHttpRequest(URI uri, @Nullable String contextPath, HttpHeaders headers) {
88+
this.uri = uri;
89+
this.path = RequestPath.parse(uri, contextPath);
90+
this.headers = HttpHeaders.readOnlyHttpHeaders(headers);
91+
}
92+
8093

8194
@Override
8295
public String getId() {

0 commit comments

Comments
 (0)