mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-30 03:14:22 +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("Server: %s\r\n"%self.server_version)
|
||||||
self.wfile.write("Content-type: text/html\r\n")
|
self.wfile.write("Content-type: text/html\r\n")
|
||||||
self.wfile.write("Content-Length: %d\r\n"%len(html_content))
|
self.wfile.write("Content-Length: %d\r\n"%len(html_content))
|
||||||
for key, value in headers.items():
|
if headers:
|
||||||
self.wfile.write("%s: %s\r\n"%(key, value))
|
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("Connection: close\r\n")
|
||||||
self.wfile.write("\r\n")
|
self.wfile.write("\r\n")
|
||||||
self.wfile.write(html_content)
|
self.wfile.write(html_content)
|
||||||
|
Loading…
Reference in New Issue
Block a user