[py3] Fixed HTTP header serialization

This commit is contained in:
Claude Paroz 2012-08-15 13:39:39 +02:00
parent de2cb5fede
commit 4d393e1bd9
1 changed files with 1 additions and 1 deletions

View File

@ -550,7 +550,7 @@ class HttpResponse(object):
def serialize(self): def serialize(self):
"""Full HTTP message, including headers, as a bytestring.""" """Full HTTP message, including headers, as a bytestring."""
headers = [ headers = [
b'%s: %s' % (key.encode('us-ascii'), value.encode('us-ascii')) ('%s: %s' % (key, value)).encode('us-ascii')
for key, value in self._headers.values() for key, value in self._headers.values()
] ]
return b'\r\n'.join(headers) + b'\r\n\r\n' + self.content return b'\r\n'.join(headers) + b'\r\n\r\n' + self.content