Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions deproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,6 @@ def handle_one_request(self, rfile, wfile):
close_connection = True
else:
close_connection = True
close_connection = True

message_chain = None
request_id = incoming_request.headers.get(request_id_header_name)
Expand Down Expand Up @@ -956,7 +955,8 @@ def handle_one_request(self, rfile, wfile):
resp = resp[0]

if (resp.body is not None and
'Content-Length' not in resp.headers):
'Content-Length' not in resp.headers and
resp.headers.get('Transfer-Encoding', '') != 'chunked'):
resp.headers.add('Content-Length', len(resp.body))

if add_default_headers:
Expand Down Expand Up @@ -1066,8 +1066,7 @@ def parse_request(self, rfile, wfile):

persistent_connection = False
if (version == 'HTTP/1.1' and
'Connection' in headers and
headers['Connection'] != 'close'):
headers.get('Connection', '') != 'close'):
persistent_connection = True

logger.debug('reading body')
Expand Down