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

SERVER_NAME setting must match host exactly #111

Open
guruofgentoo opened this issue Nov 9, 2018 · 2 comments
Open

SERVER_NAME setting must match host exactly #111

guruofgentoo opened this issue Nov 9, 2018 · 2 comments

Comments

@guruofgentoo
Copy link
Member

guruofgentoo commented Nov 9, 2018

Else all routes 404. Let's determine why that is - maybe something in request routing that matches requests to a specific flask app.

@guruofgentoo
Copy link
Member Author

level12/keg-app-cookiecutter#49 is related.

@guruofgentoo guruofgentoo assigned bchopson and unassigned bchopson Feb 22, 2021
@guruofgentoo
Copy link
Member Author

https://github.com/pallets/flask/blob/192f4ae0b2a4e7d73c0b0472e53e33250175d786/src/flask/app.py#L1711

The setting gets passed down into werkzeug for matching. Werkzeug's default is to use the host name from the request itself if that parameter is not provided. Since Flask passes it in, though, Werkzeug is flagging requests as having the wrong subdomain, issuing a warning, and responding 404 to everything.

If we want to resolve this, the easiest method will be to put a custom url_map_class on the app, and patch bind/bind_to_environ to ignore the server name. That will imply, though, that we don't want this validation on requests.

TBH I don't remember the origin of this issue - not sure if it was something we wanted to change, or just to understand why it was happening. We should discuss before proceeding.

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

No branches or pull requests

2 participants