From 4d393e1bd979984dbafa8fd040aae6223209565e Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Wed, 15 Aug 2012 13:39:39 +0200 Subject: [PATCH] [py3] Fixed HTTP header serialization --- django/http/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/http/__init__.py b/django/http/__init__.py index 930e84cddc..b9c5caa193 100644 --- a/django/http/__init__.py +++ b/django/http/__init__.py @@ -550,7 +550,7 @@ class HttpResponse(object): def serialize(self): """Full HTTP message, including headers, as a bytestring.""" 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() ] return b'\r\n'.join(headers) + b'\r\n\r\n' + self.content