From 006a8b6e9d7625074c0bdcfd717d853893bfd7d1 Mon Sep 17 00:00:00 2001 From: "Paul J. Davis" Date: Thu, 12 Aug 2010 16:09:45 -0400 Subject: [PATCH] Drop Server and Date headers in start_response. We now treat Server and Date headers as hop-by-hop headers (ie, drop them) so that they aren't repeated. While not technically hop-by-hop, the WSGI spec says we should take the role of an origin server. Fixes #79 --- gunicorn/util.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gunicorn/util.py b/gunicorn/util.py index 1ba39a3a..b3757acd 100644 --- a/gunicorn/util.py +++ b/gunicorn/util.py @@ -47,9 +47,18 @@ monthname = [None, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] +# Server and Date aren't technically hop-by-hop +# headers, but they are in the purview of the +# origin server which the WSGI spec says we should +# act like. So we drop them and add our own. +# +# In the future, concatenation server header values +# might be better, but nothing else does it and +# dropping them is easier. hop_headers = set(""" connection keep-alive proxy-authenticate proxy-authorization te trailers transfer-encoding upgrade + server date """.split()) try: