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)