[issue25095] test_httpservers hangs since Python 3.5

Martin Panter report at bugs.python.org
Fri Jan 5 15:49:44 EST 2018


Martin Panter <vadmium+py at gmail.com> added the comment:

Sorry William, I forgot the client was waiting to read. But I don’t understand why your Connection field (which comes after the status line) allows the Python client to read the status line. Perhaps there is some malware scanner, firewall, or other proxy that intercepts the HTTP protocol? (I encountered something similar at work recently.)

You said “my suggestion will never work”, but did you try setting “close_connection” on its own:

def do_GET(self):
    self.send_response(HTTPStatus.OK)
    self.end_headers()
    self.close_connection = True  # Terminate response body to proxy

You tried adding Content-Length, but did you try “Content-Length: 0”:

def do_GET(self):
    self.send_response(HTTPStatus.OK)
    self.send_header("Content-Length", "0")  # Stop proxy reading body
    self.end_headers()

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25095>
_______________________________________


More information about the Python-bugs-list mailing list