Skip to content

Commit

Permalink
Merge pull request quarkusio#35731 from geoand/quarkusio#35730
Browse files Browse the repository at this point in the history
Guard against null headers when converting a provided Response
  • Loading branch information
sberyozkin authored Sep 5, 2023
2 parents 3dbd75d + c112aa5 commit cdbdb70
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 cdbdb70

Please sign in to comment.