Merge branch '6.1.x'

This commit is contained in:
Brian Clozel
2024-10-25 10:55:00 +02:00
2 changed files with 13 additions and 2 deletions

View File

@@ -436,8 +436,11 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
if (headers == EMPTY) {
this.headers = CollectionUtils.toMultiValueMap(new LinkedCaseInsensitiveMap<>(8, Locale.ENGLISH));
}
else if (headers instanceof ReadOnlyHttpHeaders readOnlyHttpHeaders) {
this.headers = readOnlyHttpHeaders.headers;
else if (headers instanceof HttpHeaders httpHeaders) {
while (httpHeaders.headers instanceof HttpHeaders wrapped) {
httpHeaders = wrapped;
}
this.headers = httpHeaders.headers;
}
else {
this.headers = headers;