Skip to content

Commit 23f4e95

Browse files
author
Stephane Landelle
committed
Drop Proxy-Connection header, close AsyncHttpClient#404
1 parent 6559d9e commit 23f4e95

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

api/src/test/java/org/asynchttpclient/async/AsyncProvidersBasicTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ public void onThrowable(Throwable t) {
741741
}).get();
742742

743743
assertEquals(response.getStatusCode(), 200);
744-
assertEquals(response.getHeader("X-Proxy-Connection"), "keep-alive");
744+
assertEquals(response.getHeader("X-Connection"), "keep-alive");
745745
} finally {
746746
client.close();
747747
}

api/src/test/java/org/asynchttpclient/async/ProxyTunnellingTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public Response onCompleted(Response response) throws Exception {
9595
});
9696
Response r = responseFuture.get();
9797
assertEquals(r.getStatusCode(), 200);
98-
assertEquals(r.getHeader("X-Proxy-Connection"), "keep-alive");
98+
assertEquals(r.getHeader("X-Connection"), "keep-alive");
9999
} finally {
100100
asyncHttpClient.close();
101101
}
@@ -123,7 +123,7 @@ public Response onCompleted(Response response) throws Exception {
123123
});
124124
Response r = responseFuture.get();
125125
assertEquals(r.getStatusCode(), 200);
126-
assertEquals(r.getHeader("X-Proxy-Connection"), "keep-alive");
126+
assertEquals(r.getHeader("X-Connection"), "keep-alive");
127127
} finally {
128128
asyncHttpClient.close();
129129
}
@@ -141,7 +141,7 @@ public void testSimpleAHCConfigProxy() throws IOException, InterruptedException,
141141
Response r = client.get().get();
142142

143143
assertEquals(r.getStatusCode(), 200);
144-
assertEquals(r.getHeader("X-Proxy-Connection"), "keep-alive");
144+
assertEquals(r.getHeader("X-Connection"), "keep-alive");
145145
} finally {
146146
client.close();
147147
}

providers/netty/src/main/java/org/asynchttpclient/providers/netty/request/NettyRequests.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,6 @@ public static NettyRequest newNettyRequest(AsyncHttpClientConfig config, Request
317317
httpRequest.headers().set(HttpHeaders.Names.CONNECTION, AsyncHttpProviderUtils.keepAliveHeaderValue(config));
318318
}
319319

320-
// FIXME Wikipedia says that Proxy-Connection was a misunderstanding of Connection http://en.wikipedia.org/wiki/List_of_HTTP_header_fields
321-
if (!httpRequest.headers().contains("Proxy-Connection")) {
322-
httpRequest.headers().set("Proxy-Connection", AsyncHttpProviderUtils.keepAliveHeaderValue(config));
323-
}
324-
325320
final Realm realm = request.getRealm() != null ? request.getRealm() : config.getRealm();
326321

327322
String hostHeader = hostHeader(request, uri, realm);

0 commit comments

Comments
 (0)