mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 18:18:25 +00:00
fix send_error behavior if there are no headers
This commit is contained in:
parent
fd36142018
commit
84248d431b
@ -481,8 +481,9 @@ class ProxyHandler(tcp.BaseHandler):
|
||||
self.wfile.write("Server: %s\r\n"%self.server_version)
|
||||
self.wfile.write("Content-type: text/html\r\n")
|
||||
self.wfile.write("Content-Length: %d\r\n"%len(html_content))
|
||||
for key, value in headers.items():
|
||||
self.wfile.write("%s: %s\r\n"%(key, value))
|
||||
if headers:
|
||||
for key, value in headers.items():
|
||||
self.wfile.write("%s: %s\r\n"%(key, value))
|
||||
self.wfile.write("Connection: close\r\n")
|
||||
self.wfile.write("\r\n")
|
||||
self.wfile.write(html_content)
|
||||
|
Loading…
Reference in New Issue
Block a user