Skip to content
This repository has been archived by the owner on Nov 23, 2020. It is now read-only.

Pulsar treats "Date" as a hop-by-hop header #108

Closed
sekrause opened this issue Mar 31, 2014 · 1 comment
Closed

Pulsar treats "Date" as a hop-by-hop header #108

sekrause opened this issue Mar 31, 2014 · 1 comment

Comments

@sekrause
Copy link
Contributor

When I run my Flask app with Pulsar, I get a lot of log warnings like this:

13:28:02 [p=3204, t=4416, WARNING, pulsar.wsgi-worker] Application passing hop header "Date"

I get a new log entry each time Flask serves a static file simply because the reponse includes this header. Looking into pulsar/apps/wsgi/utils.py we can see that Pulsar treats the following header as hop-by-hop headers:

HOP_HEADERS = frozenset(('connection',
                         'keep-alive',
                         'proxy-authenticate',
                         'proxy-authorization',
                         'te',
                         'trailers',
                         'transfer-encoding',
                         'upgrade',
                         'server',
                         'date')
                        )

However, that seems to be in conflict with the official HTTP/1.1 RFC:

The following HTTP/1.1 headers are hop-by-hop headers:

  - Connection
  - Keep-Alive
  - Proxy-Authenticate
  - Proxy-Authorization
  - TE
  - Trailers
  - Transfer-Encoding
  - Upgrade

So server and date should probably be removed from HOP_HEADERS because it is against the spec and because frameworks like Flask which use the Date header will pollute the log file.

@lsbardel
Copy link
Member

I'm not sure why Server and Date are there! They shouldn't.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants