summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorsreehari1997 <sreeharivijayan619@gmail.com>2021-03-25 14:13:12 +0530
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-03-26 08:03:59 +0100
commit5ebb8e65dfddc70b0e91add0232fcb074006f571 (patch)
tree7d48f2de20d49b207d2e542d93a269356c65b44a /docs/ref
parent3eb72ad30f89e6774bfbf0f1223442493955fd74 (diff)
[3.2.x] Fixed #32580 -- Doc'd that HttpRequest.get_host() may raise DisallowedHost.
Backport of 0860db225a4a7059c0884c87c0a7aa0035fd0d36 from main
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/request-response.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt
index 4528373b8c..9595161671 100644
--- a/docs/ref/request-response.txt
+++ b/docs/ref/request-response.txt
@@ -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::