summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorMatt Robenolt <matt@ydekproductions.com>2015-08-02 16:56:54 -0700
committerTim Graham <timograham@gmail.com>2015-08-04 09:50:57 -0400
commit4dcfbd792342667174834c40e792f1b8ac2f0609 (patch)
tree27fd26c9e063a4aabb4427230f52f89758b25fa1 /docs/ref
parentf6259ce776eb022d1ca05fc5f4e5bc56ca1a4728 (diff)
Fixed #25211 -- Added HttpRequest.get_port() and USE_X_FORWARDED_PORT setting.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/request-response.txt8
-rw-r--r--docs/ref/settings.txt14
2 files changed, 22 insertions, 0 deletions
diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt
index 3f84d0d144..06f4d1dc4a 100644
--- a/docs/ref/request-response.txt
+++ b/docs/ref/request-response.txt
@@ -254,6 +254,14 @@ Methods
:class:`~django.middleware.common.CommonMiddleware` or
:class:`~django.middleware.csrf.CsrfViewMiddleware`.
+.. method:: HttpRequest.get_port()
+
+ .. versionadded:: 1.9
+
+ Returns the originating port of the request using information from the
+ ``HTTP_X_FORWARDED_PORT`` (if :setting:`USE_X_FORWARDED_PORT` is enabled)
+ and ``SERVER_PORT`` ``META`` variables, in that order.
+
.. method:: HttpRequest.get_full_path()
Returns the ``path``, plus an appended query string, if applicable.
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
index 0cd83615e7..1077b910f2 100644
--- a/docs/ref/settings.txt
+++ b/docs/ref/settings.txt
@@ -2621,6 +2621,19 @@ 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:: USE_X_FORWARDED_PORT
+
+USE_X_FORWARDED_PORT
+--------------------
+
+.. versionadded:: 1.9
+
+Default: ``False``
+
+A boolean that specifies whether to use the X-Forwarded-Port header in
+preference to the ``SERVER_PORT`` ``META`` variable. This should only be
+enabled if a proxy which sets this header is in use.
+
.. setting:: WSGI_APPLICATION
WSGI_APPLICATION
@@ -3329,6 +3342,7 @@ HTTP
* :setting:`SIGNING_BACKEND`
* :setting:`USE_ETAGS`
* :setting:`USE_X_FORWARDED_HOST`
+* :setting:`USE_X_FORWARDED_PORT`
* :setting:`WSGI_APPLICATION`
Logging