From f7bd2362fa658d523081618d3974b9b68f9f988d Mon Sep 17 00:00:00 2001 From: Robert Butts Date: Thu, 4 Feb 2021 12:06:30 -0700 Subject: [PATCH] Fix KA header not checking strategy Fixes handle_request_keep_alive_headers directly checking the old parentage for parent_is_proxy, instead of the abstract func which checks the strategy if it exists. This would cause the Connection header to get added instead of the correct Proxy-Connection when Strategies are used. --- 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 b89d7f43212..be61bd3075c 100644 --- a/proxy/http/HttpTransact.cc +++ b/proxy/http/HttpTransact.cc @@ -6756,7 +6756,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 && s->parent_result.parent_is_proxy()) { + if (s->current.request_to == PARENT_PROXY && parent_is_proxy(s)) { 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); @@ -6770,7 +6770,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 && s->parent_result.parent_is_proxy()) { + if (s->current.request_to == PARENT_PROXY && parent_is_proxy(s)) { 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);