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

check request.trusted_hosts in Map.bind_to_environ #3007

Open
davidism opened this issue Nov 13, 2024 · 1 comment · May be fixed by #3008
Open

check request.trusted_hosts in Map.bind_to_environ #3007

davidism opened this issue Nov 13, 2024 · 1 comment · May be fixed by #3008
Assignees
Milestone

Comments

@davidism
Copy link
Member

Map.bind_to_environ can be passed an environ or a request object. But it always calls get_host(environ). If it used request.host if a request was passed, this would check request.trusted_hosts during routing. See pallets/flask#5636

@davidism
Copy link
Member Author

Consider making request.trusted_hosts a property, so setting it would automatically trigger validation. I'm not sure if this is a good idea or not. It's not particularly useful in Werkzeug, where the request is available to be configured before routing. It's only really convenient in Flask where a view (after routing) may want to set specific trusted hosts.

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 a pull request may close this issue.

1 participant