Use a space to separate header name and contents for forwarded headers
This commit is contained in:
parent
0ac0006a63
commit
636cb9b92d
|
@ -230,7 +230,7 @@ def proxy(sock, host):
|
||||||
# Remove headers that don't need forwarding or are overwritten
|
# 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 = 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
|
# Split url into its constituents
|
||||||
fields = url.split(b'://', 1)
|
fields = url.split(b'://', 1)
|
||||||
|
@ -275,7 +275,7 @@ def proxy(sock, host):
|
||||||
try:
|
try:
|
||||||
remote_sock.sendall(method + b' ' + path + b' ' + protocol + b'\r\n')
|
remote_sock.sendall(method + b' ' + path + b' ' + protocol + b'\r\n')
|
||||||
for key, value in headers.items():
|
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(b'\r\n')
|
||||||
remote_sock.sendall(request_data)
|
remote_sock.sendall(request_data)
|
||||||
except (ConnectionResetError, BrokenPipeError):
|
except (ConnectionResetError, BrokenPipeError):
|
||||||
|
|
Loading…
Reference in New Issue