fix send_error behavior if there are no headers

This commit is contained in:
Maximilian Hils 2013-06-17 10:52:19 +02:00
parent fd36142018
commit 84248d431b

View File

@ -481,6 +481,7 @@ 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))
if headers:
for key, value in headers.items(): for key, value in headers.items():
self.wfile.write("%s: %s\r\n"%(key, value)) self.wfile.write("%s: %s\r\n"%(key, value))
self.wfile.write("Connection: close\r\n") self.wfile.write("Connection: close\r\n")