Skip to content

Commit

Permalink
Guard against null headers when converting a provided Response
Browse files Browse the repository at this point in the history
Relates to: quarkusio#35730
  • Loading branch information
geoand committed Sep 5, 2023
1 parent 59536b2 commit c112aa5
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,13 @@ private ResponseBuilderImpl fromResponse(Response response) {
if (response.hasEntity()) {
b.entity(response.getEntity());
}
for (String headerName : response.getHeaders().keySet()) {
List<Object> headerValues = response.getHeaders().get(headerName);
for (Object headerValue : headerValues) {
b.header(headerName, headerValue);
var headers = response.getHeaders();
if (headers != null) {
for (String headerName : headers.keySet()) {
List<Object> headerValues = headers.get(headerName);
for (Object headerValue : headerValues) {
b.header(headerName, headerValue);
}
}
}
return (ResponseBuilderImpl) b;
Expand Down

0 comments on commit c112aa5

Please sign in to comment.