From e854fb1ad32cbd0ebefa9454bcfba4c1ac3fd913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Fri, 15 Oct 2021 12:56:58 +0300 Subject: [PATCH] Don't pass through connection: keep-alive --- untls_proxy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/untls_proxy.py b/untls_proxy.py index 46b93a8..ad5441b 100755 --- a/untls_proxy.py +++ b/untls_proxy.py @@ -227,10 +227,10 @@ def proxy(sock, host): del username del password - # Remove headers that don't need forwarding - headers = dict((key, value) for key, value in headers.items() if not key.startswith(b'proxy-')) + # Remove headers that don't need forwarding or are overwritten + headers = dict((key, value) for key, value in headers.items() if not key.startswith(b'proxy-') and not key in (b'connection', b'keep-alive')) - # TODO: connection: close + headers[b'connection'] = b' close' # Split url into its constituents fields = url.split(b'://', 1)