Skip to content

Commit 8bd3516

Browse files
author
Stephane Landelle
committed
NettyAsyncHttpProvider shouldn't use FluentCaseInsensitiveStringsMap.getKeys that uselessly creates a new Map, close #326
1 parent f26c33c commit 8bd3516

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/main/java/com/ning/http/client/providers/netty/NettyAsyncHttpProvider.java

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

645645
if (!m.equals(HttpMethod.CONNECT)) {
646-
FluentCaseInsensitiveStringsMap h = request.getHeaders();
647-
if (h != null) {
648-
for (String name : h.keySet()) {
649-
if (!"host".equalsIgnoreCase(name)) {
650-
for (String value : h.get(name)) {
651-
nettyRequest.addHeader(name, value);
652-
}
646+
for (Entry<String, List<String>> header : request.getHeaders()) {
647+
String name = header.getKey();
648+
if (!HttpHeaders.Names.HOST.equalsIgnoreCase(name)) {
649+
for (String value : header.getValue()) {
650+
nettyRequest.addHeader(name, value);
653651
}
654652
}
655653
}

0 commit comments

Comments
 (0)