I don't see any good reason to keep Status here. Also since we are

HTTP/1.1 make sure to use correct status line
This commit is contained in:
benoitc 2010-03-04 19:46:38 +01:00
parent d26073cc78
commit c67800e1c7
2 changed files with 2 additions and 4 deletions

View File

@ -19,12 +19,10 @@ class Response(object):
def send(self):
# send headers
resp_head = []
resp_head.append("HTTP/1.0 %s\r\n" % (self.status))
resp_head.append("HTTP/1.1 %s\r\n" % (self.status))
resp_head.append("Server: %s\r\n" % self.SERVER_VERSION)
resp_head.append("Date: %s\r\n" % http_date())
# broken clients
resp_head.append("Status: %s\r\n" % str(self.status))
# always close the connection
resp_head.append("Connection: close\r\n")
for name, value in self.headers:

View File

@ -134,7 +134,7 @@ def write_error(sock, msg):
</html>
""") % msg
http = textwrap.dedent("""\
HTTP/1.0 500 Internal Server Error\r
HTTP/1.1 500 Internal Server Error\r
Connection: close\r
Content-Type: text/html\r
Content-Length: %d\r