From 5ea979bd2566347cb3b284021255f9e25da448a8 Mon Sep 17 00:00:00 2001 From: Valentin Gutierrez Date: Thu, 14 May 2020 16:11:36 +0000 Subject: [PATCH] Use Proxy-Connection iff parent_is_proxy=true Prior to this change a parent proxy configured as parent_is_proxy=false would get Proxy-Connection: keep-alive|close instead of Connection: keep-alive|close --- proxy/http/HttpTransact.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc index a41e389c83a..d985b00571a 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -6844,7 +6844,7 @@ HttpTransact::handle_request_keep_alive_headers(State *s, HTTPVersion ver, HTTPH case KA_CONNECTION: ink_assert(s->current.server->keep_alive != HTTP_NO_KEEPALIVE); if (ver == HTTPVersion(1, 0)) { - if (s->current.request_to == PARENT_PROXY) { + if (s->current.request_to == PARENT_PROXY && s->parent_result.parent_is_proxy()) { heads->value_set(MIME_FIELD_PROXY_CONNECTION, MIME_LEN_PROXY_CONNECTION, "keep-alive", 10); } else { heads->value_set(MIME_FIELD_CONNECTION, MIME_LEN_CONNECTION, "keep-alive", 10); @@ -6858,7 +6858,7 @@ HttpTransact::handle_request_keep_alive_headers(State *s, HTTPVersion ver, HTTPH if (s->current.server->keep_alive != HTTP_NO_KEEPALIVE || (ver == HTTPVersion(1, 1))) { /* Had keep-alive */ s->current.server->keep_alive = HTTP_NO_KEEPALIVE; - if (s->current.request_to == PARENT_PROXY) { + if (s->current.request_to == PARENT_PROXY && s->parent_result.parent_is_proxy()) { heads->value_set(MIME_FIELD_PROXY_CONNECTION, MIME_LEN_PROXY_CONNECTION, "close", 5); } else { heads->value_set(MIME_FIELD_CONNECTION, MIME_LEN_CONNECTION, "close", 5);