From 636cb9b92d77adc306f20e199f38568da5295f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Sun, 17 Oct 2021 19:02:51 +0300 Subject: [PATCH] Use a space to separate header name and contents for forwarded headers --- untls_proxy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/untls_proxy.py b/untls_proxy.py index b825270..02957f3 100755 --- a/untls_proxy.py +++ b/untls_proxy.py @@ -230,7 +230,7 @@ def proxy(sock, host): # 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')) - headers[b'connection'] = b' close' + headers[b'connection'] = b'close' # Split url into its constituents fields = url.split(b'://', 1) @@ -275,7 +275,7 @@ def proxy(sock, host): try: remote_sock.sendall(method + b' ' + path + b' ' + protocol + b'\r\n') for key, value in headers.items(): - remote_sock.sendall(key + b':' + value + b'\r\n') + remote_sock.sendall(key + b': ' + value + b'\r\n') remote_sock.sendall(b'\r\n') remote_sock.sendall(request_data) except (ConnectionResetError, BrokenPipeError):