mirror of
https://github.com/pallets-eco/flask-debugtoolbar.git
synced 2025-12-31 02:29:33 -06:00
Allows configuration of Flask-DebugToolbar to support a Flask app running in `host_matching` mode. When Flask is configured this way, routes are each tied to a `host` definition. This can either be a single explicit host, or a host definition that includes variable values similar to Werkzeug path definitions, eg `<subdomain>.toolbar.com`. Handling explicit domains is simple, as the host can be passed through directly - and this happens automatically. If the host contains any variable parts, then calls to `url_for` need to be able to access the appropriate values for those variables. If the host string specified by the user contains arbitrary variables, it's difficult for the toolbar to know what those should evaluate to. So we restrict the possible options for the toolbar host to one of two options here: either a single explicit host, or a full-wildcard host. The wildcard host is managed internally by Flask-DebugToolbar so that we know: 1) the variable name, and 2) what value to inject for it (the current request's host).