Restore HttpHeaders-based constructor for binary compatibility

Closes gh-26151
This commit is contained in:
Juergen Hoeller
2020-11-25 11:36:12 +01:00
parent 86f9716fef
commit 73e1f24ac1

View File

@@ -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<String, String> 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() {