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
This commit is contained in:
Paul J. Davis 2010-08-12 16:09:45 -04:00
parent d37f0a6555
commit 006a8b6e9d

View File

@ -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: