Instantiate the CID directly.
authorCory Benfield <lukasaoz@gmail.com>
Wed, 1 May 2013 20:49:46 +0000 (21:49 +0100)
committerCory Benfield <lukasaoz@gmail.com>
Mon, 29 Jul 2013 13:52:44 +0000 (14:52 +0100)
No need to do this the slow way now. Thanks to Colin (@cdunklau) for the
idea.

requests/models.py

index 62cd0f564e23f5d990b80620121756265c22b9e0..10fa1f0f7d3b291145296a6c4b297c135a120f89 100644 (file)
@@ -346,8 +346,7 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):
         """Prepares the given HTTP headers."""
 
         if headers:
-            headers = dict((to_native_string(name), value) for name, value in headers.items())
-            self.headers = CaseInsensitiveDict(headers)
+            self.headers = CaseInsensitiveDict((to_native_string(name), value) for name, value in headers.items())
         else:
             self.headers = CaseInsensitiveDict()