Skip to content

Commit

Permalink
use stream api
Browse files Browse the repository at this point in the history
  • Loading branch information
sdelamo committed Apr 5, 2023
1 parent 0f624cb commit 52b852e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ private static Map<String, String> getHeaders(AwsProxyResponse awsProxyResponse)
Map<String, String> headers = new LinkedHashMap<>();
for (Map.Entry<String, List<String>> entry : multiValueHeaders.entrySet()) {
List<String> headerValues = entry.getValue();
if (headerValues != null && headerValues.size() == 1) {
headers.put(entry.getKey(), headerValues.get(0));
if (headerValues != null) {
headerValues.stream().findFirst()
.ifPresent(value -> headers.put(entry.getKey(), value));
}
}
return headers;
Expand Down

0 comments on commit 52b852e

Please sign in to comment.