mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
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:
parent
d37f0a6555
commit
006a8b6e9d
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user