summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/request-response.txt9
-rw-r--r--docs/ref/settings.txt13
2 files changed, 18 insertions, 4 deletions
diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt
index fd01cf9138..7837b6bede 100644
--- a/docs/ref/request-response.txt
+++ b/docs/ref/request-response.txt
@@ -185,10 +185,11 @@ Methods
.. method:: HttpRequest.get_host()
- Returns the originating host of the request using information from the
- ``HTTP_X_FORWARDED_HOST`` and ``HTTP_HOST`` headers (in that order). If
- they don't provide a value, the method uses a combination of
- ``SERVER_NAME`` and ``SERVER_PORT`` as detailed in `PEP 333`_.
+ Returns the originating host of the request using information from
+ the ``HTTP_X_FORWARDED_HOST`` (if enabled in the settings) and ``HTTP_HOST``
+ headers (in that order). If they don't provide a value, the method
+ uses a combination of ``SERVER_NAME`` and ``SERVER_PORT`` as
+ detailed in :pep:`3333`.
.. _PEP 333: http://www.python.org/dev/peps/pep-0333/
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
index 33011c08e9..43b56d7844 100644
--- a/docs/ref/settings.txt
+++ b/docs/ref/settings.txt
@@ -1698,6 +1698,19 @@ and ``NUMBER_GROUPING`` from current locale, to format the number.
See also ``THOUSAND_SEPARATOR`` and ``NUMBER_GROUPING``.
+.. setting:: USE_X_FORWARDED_HOST
+
+USE_X_FORWARDED_HOST
+--------------------
+
+.. versionadded:: 1.3.1
+
+Default: ``False``
+
+A boolean that specifies whether to use the X-Forwarded-Host header in
+preference to the Host header. This should only be enabled if a proxy
+which sets this header is in use.
+
.. setting:: YEAR_MONTH_FORMAT
YEAR_MONTH_FORMAT