configure and check trusted_hosts

This commit is contained in:
David Lord 2024-11-12 20:32:53 -08:00
parent 10bdf61a0f
commit 4f7156f2c3
No known key found for this signature in database
GPG key ID: 43368A7AA8CC5926
4 changed files with 40 additions and 0 deletions

View file

@ -258,6 +258,21 @@ The following configuration values are used internally by Flask:
Default: ``None``
.. py:data:: TRUSTED_HOSTS
Validate :attr:`.Request.host` and other attributes that use it against
these trusted values. Raise a :exc:`~werkzeug.exceptions.SecurityError` if
the host is invalid, which results in a 400 error. If it is ``None``, all
hosts are valid. Each value is either an exact match, or can start with
a dot ``.`` to match any subdomain.
Validation is done during routing against this value. ``before_request`` and
``after_request`` callbacks will still be called.
Default: ``None``
.. versionadded:: 3.1
.. py:data:: SERVER_NAME
Inform the application what host and port it is bound to.