fix keepalive response.

The expected response for keeep alive connections are Connection:
keep-alive not keepalive.
This commit is contained in:
benoitc 2012-03-01 08:18:20 +01:00
parent 1319543448
commit a3a655928d

View File

@ -222,7 +222,7 @@ class Response(object):
elif self.should_close():
connection = "close"
else:
connection = "keepalive"
connection = "keep-alive"
headers = [
"HTTP/%s.%s %s\r\n" % (self.req.version[0],
@ -240,6 +240,7 @@ class Response(object):
return
tosend = self.default_headers()
tosend.extend(["%s: %s\r\n" % (n, v) for n, v in self.headers])
print tosend
util.write(self.sock, "%s\r\n" % "".join(tosend))
self.headers_sent = True