Fix 'Connection' header in HttpClientConnection
@@ -240,7 +240,9 @@ final class HttpClientConnection extends AbstractHttpConnection {
(pool = client.poolReadWrite).addLastNode(this);
poolTimestamp = eventloop.currentTimeMillis();
HttpHeaderValue connectionHeader = CONNECTION_KEEP_ALIVE_HEADER;
- if (client.maxKeepAliveRequests != 0) {
+ if (client.keepAliveTimeoutMillis == 0) {
+ connectionHeader = CONNECTION_CLOSE_HEADER;
+ } else if (client.maxKeepAliveRequests != 0) {
if (++numberOfKeepAliveRequests >= client.maxKeepAliveRequests) {
connectionHeader = CONNECTION_CLOSE_HEADER;
}
