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

(cherry picked from commit c112aa5)
  • Loading branch information
geoand authored and aloubyansky committed Oct 25, 2023
1 parent 5ec196c commit 5cc9363
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 5cc9363

Please sign in to comment.