Having a Hard Time Replacing Default Server Header
See original GitHub issueHello;
I’m using uvicorn to front-end an ASGI application of mine and I’m loving it! There is only one slight marring of the beautiful steed which is uvicorn; I have been unable to find a means whereby I can over-ride the sending of the Server: uvicorn
header on all outbound responses.
When using HTTP1.1 as the transport protocol, I see in the uvicorn.protocols.http.h11_impl module a _get_default_headers
function. I can see that this in turn gets called by H11Protocol#tick
, which overrides whatever value that the global DEFAULT_HEADERS
variable holds, which in turn is what gets augmented to the headers of every outbound request in the RequestResponseCycle#send
method.
Is there a strong reason for this? If not, is there any desire with the existing devs to enable this to be disabled/changed? Or, is there a desired approach that someone else should take if they would wish to introduce a PR that would change this behaviour?
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (11 by maintainers)
Top GitHub Comments
Yup - it’d be available as part of the
Config
PR has been merged which resolves this issue.