Skip to content

Commit 7b75d54

Browse files
author
Stephane Landelle
committed
NettyAsyncHttpProvider shouldn't use FluentCaseInsensitiveStringsMap.getKeys that uselessly creates a new Map, close AsyncHttpClient#326
1 parent 5c5923f commit 7b75d54

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

providers/netty/src/main/java/org/asynchttpclient/providers/netty/NettyAsyncHttpProvider.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -619,13 +619,11 @@ else if (uri.getRawQuery() != null)
619619
}
620620

621621
if (!m.equals(HttpMethod.CONNECT)) {
622-
FluentCaseInsensitiveStringsMap h = request.getHeaders();
623-
if (h != null) {
624-
for (String name : h.keySet()) {
625-
if (!"host".equalsIgnoreCase(name)) {
626-
for (String value : h.get(name)) {
627-
nettyRequest.addHeader(name, value);
628-
}
622+
for (Entry<String, List<String>> header : request.getHeaders()) {
623+
String name = header.getKey();
624+
if (!HttpHeaders.Names.HOST.equalsIgnoreCase(name)) {
625+
for (String value : header.getValue()) {
626+
nettyRequest.addHeader(name, value);
629627
}
630628
}
631629
}

0 commit comments

Comments
 (0)