Closed serkonda7 closed 1 year ago
You'd need to patch Waitress, I'm afraid. Here's the relevant piece of code: https://github.com/Pylons/waitress/blob/455f2a5fd38cafab95893ca170c7504e4239d985/src/waitress/task.py#L258 Changing the code to this would do the trick:
if ident:
if not server_header:
response_headers.append(("Server", ident))
else:
response_headers.append(("Via", ident))
You could supply this change as a PR, if you think it's worth merging.
Thank you for this extensive answer. I don't think this is worthwhile a PR tho.
Why not just set ident to something you’re comfortable with?
Weird requirements doe not allow to set a static Value for the Server header
What is your proposal if a PR is not worthwhile? You can always overwrite the header in your reverse proxy (waitress should never be exposed directly to the public internet).
Exactly your stated solution. Reverse Proxy stripping the Via header
Alright, I'll close this then but thank you for pointing out this issue. Will think about it if more use cases come up.
My app adds a custom
Server
header. However when serving with waitress, aVia
header is added.I have removed the default value of
Server
in the following line and do not want theVia
header either.In the docs I haven't found such config option. How to remove
Via
?