Open davidism opened 1 week ago
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.
Map.bind_to_environ
can be passed an environ or a request object. But it always callsget_host(environ)
. If it usedrequest.host
if a request was passed, this would checkrequest.trusted_hosts
during routing. See pallets/flask#5636