diff options
| author | Michael Manfre <mmanfre@gmail.com> | 2013-05-01 12:13:09 -0600 |
|---|---|---|
| committer | Carl Meyer <carl@oddbird.net> | 2013-05-01 12:13:44 -0600 |
| commit | 6bdeed1b811ddf9a920e925ad05d82cffbf13c3a (patch) | |
| tree | 175d536d9108ca9f072574aafb93414c55237d58 /docs | |
| parent | 780fa48f5fb81b2f0f58de95167abff84a6149aa (diff) | |
Fixed #20338 - Document FQDN behavior with ALLOWED_HOSTS
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/settings.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index 01c9089028..f2d418d4d9 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -79,6 +79,20 @@ responsible to provide your own validation of the ``Host`` header (perhaps in a middleware; if so this middleware must be listed first in :setting:`MIDDLEWARE_CLASSES`). +.. note:: + + If you want to also allow the `fully qualified domain name (FQDN)`_, which + some browsers can send in the Host header, you must explicitly add another + ALLOWED_HOSTS entry that includes a trailing period. This entry can also be + a subdomain wildcard:: + + ALLOWED_HOSTS = [ + '.example.com', # Allow domain and subdomains + '.example.com.', # Also allow FQDN and subdomains + ] + +.. _`fully qualified domain name (FQDN)`: http://en.wikipedia.org/wiki/Fully_qualified_domain_name + If the ``Host`` header (or ``X-Forwarded-Host`` if :setting:`USE_X_FORWARDED_HOST` is enabled) does not match any value in this list, the :meth:`django.http.HttpRequest.get_host()` method will raise |
