Values can be none #433
authorKenneth Reitz <me@kennethreitz.com>
Mon, 20 Feb 2012 17:30:12 +0000 (12:30 -0500)
committerKenneth Reitz <me@kennethreitz.com>
Mon, 20 Feb 2012 17:30:12 +0000 (12:30 -0500)
requests/utils.py

index adb3414..97f5860 100644 (file)
@@ -154,6 +154,8 @@ def header_expand(headers):
         # latin-1 is the most conservative encoding used on the web. Anyone
         # who needs more can encode to a byte-string before calling
         return headers.encode("latin-1")
+    elif headers is None:
+        return headers
 
     for i, (value, params) in enumerate(headers):