Browse Source

Fixed #32580 -- Doc'd that HttpRequest.get_host() may raise DisallowedHost.

sreehari1997 4 years ago
parent
commit
0860db225a
2 changed files with 5 additions and 0 deletions
  1. 1 0
      AUTHORS
  2. 4 0
      docs/ref/request-response.txt

+ 1 - 0
AUTHORS

@@ -855,6 +855,7 @@ answer newbie questions, and generally made Django that much better:
     sloonz <simon.lipp@insa-lyon.fr>
     sloonz <simon.lipp@insa-lyon.fr>
     smurf@smurf.noris.de
     smurf@smurf.noris.de
     sopel
     sopel
+    Sreehari K V <sreeharivijayan619@gmail.com>
     Srinivas Reddy Thatiparthy <thatiparthysreenivas@gmail.com>
     Srinivas Reddy Thatiparthy <thatiparthysreenivas@gmail.com>
     Stanislas Guerra <stan@slashdev.me>
     Stanislas Guerra <stan@slashdev.me>
     Stanislaus Madueke
     Stanislaus Madueke

+ 4 - 0
docs/ref/request-response.txt

@@ -290,6 +290,10 @@ Methods
 
 
     Example: ``"127.0.0.1:8000"``
     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
     .. note:: The :meth:`~HttpRequest.get_host()` method fails when the host is
         behind multiple proxies. One solution is to use middleware to rewrite
         behind multiple proxies. One solution is to use middleware to rewrite
         the proxy headers, as in the following example::
         the proxy headers, as in the following example::