From 099d00c4acaaa28f660d3a941eaadbaa012b5924 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 19 Feb 2022 11:56:54 +0000 Subject: [PATCH] HTTP proxy: accept the 'Proxy-Connection' header. FreeProxy sends this as a substitute for the standard 'Connection' header (with the same contents, i.e. 'keep-alive' or 'close' depending on whether the TCP connection is going to continue afterwards). The Internet reckons it's not standard, but it's easy to recognise as an ad-hoc synonym for 'Connection'. --- proxy/http.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/proxy/http.c b/proxy/http.c index e01329ea..761abdf6 100644 --- a/proxy/http.c +++ b/proxy/http.c @@ -154,6 +154,7 @@ static void proxy_http_free(ProxyNegotiator *pn) X(HDR_CONTENT_LENGTH, "Content-Length") \ X(HDR_TRANSFER_ENCODING, "Transfer-Encoding") \ X(HDR_PROXY_AUTHENTICATE, "Proxy-Authenticate") \ + X(HDR_PROXY_CONNECTION, "Proxy-Connection") \ /* end of list */ typedef enum HttpHeader { @@ -550,7 +551,8 @@ static void proxy_http_process_queue(ProxyNegotiator *pn) if (!stricmp(s->token->s, "chunked")) s->chunked_transfer = true; } - } else if (hdr == HDR_CONNECTION) { + } else if (hdr == HDR_CONNECTION || + hdr == HDR_PROXY_CONNECTION) { if (!get_token(s)) continue; if (!stricmp(s->token->s, "close"))