Commits

Robert Brewer committed 1fdac5d

Removed obsolete code for multivalent HeaderMap entries.

Comments (0)

Files changed (1)

cherrypy/lib/http.py

     def output(self, protocol=(1, 1)):
         """Transform self into a list of (name, value) tuples."""
         header_list = []
-        for key, value in self.iteritems():
-            if not isinstance(value, list):
-                value = [value]
-            for v in value:
-                if isinstance(v, unicode):
-                    # HTTP/1.0 says, "Words of *TEXT may contain octets
-                    # from character sets other than US-ASCII." and
-                    # "Recipients of header field TEXT containing octets
-                    # outside the US-ASCII character set may assume that
-                    # they represent ISO-8859-1 characters."
-                    try:
-                        v = v.encode("iso-8859-1")
-                    except UnicodeEncodeError:
-                        if protocol >= (1, 1):
-                            # Encode RFC-2047 TEXT
-                            # (e.g. u"\u8200" -> "=?utf-8?b?6IiA?=").
-                            v = Header(v, 'utf-8').encode()
-                        else:
-                            raise
-                else:
-                    # This coercion should not take any time at all
-                    # if value is already of type "str".
-                    v = str(v)
-                header_list.append((key, v))
+        for key, v in self.iteritems():
+            if isinstance(v, unicode):
+                # HTTP/1.0 says, "Words of *TEXT may contain octets
+                # from character sets other than US-ASCII." and
+                # "Recipients of header field TEXT containing octets
+                # outside the US-ASCII character set may assume that
+                # they represent ISO-8859-1 characters."
+                try:
+                    v = v.encode("iso-8859-1")
+                except UnicodeEncodeError:
+                    if protocol >= (1, 1):
+                        # Encode RFC-2047 TEXT
+                        # (e.g. u"\u8200" -> "=?utf-8?b?6IiA?=").
+                        v = Header(v, 'utf-8').encode()
+                    else:
+                        raise
+            else:
+                # This coercion should not take any time at all
+                # if value is already of type "str".
+                v = str(v)
+            header_list.append((key, v))
         return header_list
 
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.