Commits

Robert Brewer committed f6c1b1d

Fix for WSGI server if the same comma-separated header appears in both headers and trailer.

  • Participants
  • Parent commits c24abe4

Comments (0)

Files changed (1)

cherrypy/_cpwsgiserver.py

         for k in headers.keys():
             envname = "HTTP_" + k.upper().replace("-", "_")
             if k in comma_separated_headers:
-                environ[envname] = ", ".join(headers.getheaders(k))
+                existing = environ.get(envname)
+                if existing:
+                    environ[envname] = ", ".join([existing] + headers.getheaders(k))
+                else:
+                    environ[envname] = ", ".join(headers.getheaders(k))
             elif k in ('Transfer-Encoding',):
                 pass
             else: