Don't pass through connection: keep-alive

This commit is contained in:
Juhani Krekelä 2021-10-15 12:56:58 +03:00
parent 8cbaa722b1
commit e854fb1ad3
1 changed files with 3 additions and 3 deletions

View File

@ -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)