Skip to content

RestClientResponseException handles responseHeaders case-sensitive #31978

@MnlK

Description

@MnlK

Starting with spring-web 6.1.2, the HttpHeaders supplied to RestClientResponseException are copied into a new LinkedMultiValueMap, that is not case-insensitive anymore.
Headers from getResponseHeaders() can then no longer be found without the correct case.

public RestClientResponseException( String message, HttpStatusCode statusCode, String statusText, @Nullable HttpHeaders headers, @Nullable byte[] responseBody, @Nullable Charset responseCharset) {	... this.responseHeaders = copyHeaders(headers);	... } private static HttpHeaders copyHeaders(@Nullable HttpHeaders headers) { if (headers != null) { MultiValueMap<String, String> result = new LinkedMultiValueMap<>(headers.size()); headers.forEach((name, values) -> values.forEach(value -> result.add(name, value))); return HttpHeaders.readOnlyHttpHeaders(result);	} else { return null;	} }

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions