diff options
| author | Matt Robenolt <matt@ydekproductions.com> | 2015-08-02 16:56:54 -0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-08-04 09:50:57 -0400 |
| commit | 4dcfbd792342667174834c40e792f1b8ac2f0609 (patch) | |
| tree | 27fd26c9e063a4aabb4427230f52f89758b25fa1 /docs | |
| parent | f6259ce776eb022d1ca05fc5f4e5bc56ca1a4728 (diff) | |
Fixed #25211 -- Added HttpRequest.get_port() and USE_X_FORWARDED_PORT setting.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/request-response.txt | 8 | ||||
| -rw-r--r-- | docs/ref/settings.txt | 14 | ||||
| -rw-r--r-- | docs/releases/1.9.txt | 3 |
3 files changed, 25 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 diff --git a/docs/releases/1.9.txt b/docs/releases/1.9.txt index f016a08c32..6f2611f267 100644 --- a/docs/releases/1.9.txt +++ b/docs/releases/1.9.txt @@ -538,6 +538,9 @@ Requests and Responses returning an :class:`~django.http.HttpResponseForbidden` so that :data:`~django.conf.urls.handler403` is invoked. +* Added :meth:`HttpRequest.get_port() <django.http.HttpRequest.get_port>` to + fetch the originating port of the request. + Tests ^^^^^ |
