Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup: Server Name deduction logic #329

Merged
merged 4 commits into from
Nov 27, 2020
Merged

Conversation

digitalresistor
Copy link
Member

@digitalresistor digitalresistor commented Nov 27, 2020

Waitress always used to assume that it would be running on a system where there was a correctly implemented DNS system that would return the hostname when doing a reverse DNS lookup on the IP address it was bound to, or that the system would return the IP address itself.

This is however not the case as seen in #312, #283, #268, #311 and issues in #149.

So now the logic is simplified even further. We don't attempt do anything of the sort anymore at all. Waitress has learned a new configuration value called server_name. The default is waitress.invalid.

The only time that a user will see this value if the following is true: the request arrives over HTTP 1.0 and the remote client does not set a Host header.

In no other situation does the server_name value, which is used in the WSGI environment SERVER_NAME matter because it should be overridden with the Host header sent by the client, or if using a Proxy, can be set on Forwarded/X-Forwarded-Host.

Closes #312
Closes #150

Copy link
Member

@mmerickel mmerickel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice much simpler. One question on naming. Maybe prefix it like wsgi_server_name or something to avoid confusion with ident? Throwing it out there.

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

Successfully merging this pull request may close these issues.

ValueError: Requires an IP to get the server name duplicate output when using multiple listen directives
2 participants