From fef233dd5df2a53674b72de955449f026d7532d8 Mon Sep 17 00:00:00 2001 From: benoitc Date: Wed, 5 Oct 2011 14:16:41 +0200 Subject: [PATCH] manage multiple headers entry. Rather than waiting for the new HTTP parser apply this patch now. Thanks @taejo for the patch. close #267 --- gunicorn/http/wsgi.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gunicorn/http/wsgi.py b/gunicorn/http/wsgi.py index d42c229d..03f7b4ba 100644 --- a/gunicorn/http/wsgi.py +++ b/gunicorn/http/wsgi.py @@ -91,8 +91,10 @@ def create(req, sock, client, server, cfg): elif hdr_name == "CONTENT-LENGTH": environ['CONTENT_LENGTH'] = hdr_value continue - + key = 'HTTP_' + hdr_name.replace('-', '_') + if key in environ: + hdr_value = "%s,%s" % (environ[key], hdr_value) environ[key] = hdr_value environ['wsgi.url_scheme'] = url_scheme