mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #32580 -- Doc'd that HttpRequest.get_host() may raise DisallowedHost.
This commit is contained in:
parent
cac9ec73db
commit
0860db225a
2 changed files with 5 additions and 0 deletions
|
@ -290,6 +290,10 @@ Methods
|
|||
|
||||
Example: ``"127.0.0.1:8000"``
|
||||
|
||||
Raises ``django.core.exceptions.DisallowedHost`` if the host is not in
|
||||
:setting:`ALLOWED_HOSTS` or the domain name is invalid according to
|
||||
:rfc:`1034`/:rfc:`1035 <1035>`.
|
||||
|
||||
.. note:: The :meth:`~HttpRequest.get_host()` method fails when the host is
|
||||
behind multiple proxies. One solution is to use middleware to rewrite
|
||||
the proxy headers, as in the following example::
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue