* ui_ux: => 0
* easy: => 0
* stage: Design decision needed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/7603#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* has_patch: 0 => 1
Comment:
Patch: https://github.com/unaizalakain/django/tree/ticket_7603
HttpRequest.get_scheme() uses self.is_secure() to determine if scheme is
'http' or 'https' wether WSGIRequest.get_scheme() makes use of the
'wsgi.url_scheme' WSGI environ variable.
This provides a handful method to check for current scheme in, for
example, templates. It also allows to deal with other schemes.
--
Ticket URL: <https://code.djangoproject.com/ticket/7603#comment:10>
* needs_better_patch: 0 => 1
Comment:
Comments for improvement on the branch.
--
Ticket URL: <https://code.djangoproject.com/ticket/7603#comment:11>
Comment (by unaizalakain):
Comments taken into account, pull request:
https://github.com/django/django/pull/1730
--
Ticket URL: <https://code.djangoproject.com/ticket/7603#comment:12>
--
Ticket URL: <https://code.djangoproject.com/ticket/7603#comment:13>
* owner: nslater => unaizalakain
--
Ticket URL: <https://code.djangoproject.com/ticket/7603#comment:14>
* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin
Comment:
This looks good to me, but since it's potentially security related I'd
like one more +1 before committing.
--
Ticket URL: <https://code.djangoproject.com/ticket/7603#comment:15>
Comment (by aaugustin):
LGTM.
Why do the docs say "normally" and "usually"? The current implementation
is always going to return 'http' or 'https'. Let's avoid vague terms.
--
Ticket URL: <https://code.djangoproject.com/ticket/7603#comment:16>
Comment (by unaizalakain):
In fact, scheme is gotten from `wsgi.url_scheme` WSGI variable.
[[http://wsgi.readthedocs.org/en/latest/definitions.html?highlight=url_scheme
#envvar-wsgi.url_scheme|The docs]] state that:
`wsgi.url_scheme`: A string representing the "scheme" portion of the
URL at which the application is being invoked. Normally, this will have
the value "http" or "https", as appropriate.
It's true that this will always be `http` or `https` but there's no
guarantee about it.
--
Ticket URL: <https://code.djangoproject.com/ticket/7603#comment:17>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"c7634cd7fe7dc09338fcec0ca48d816a29d791b0"]:
{{{
#!CommitTicketReference repository=""
revision="c7634cd7fe7dc09338fcec0ca48d816a29d791b0"
Fixed #7603 -- Added a 'scheme' property to the HttpRequest object
`HttpRequest.scheme` is `https` if `settings.SECURE_PROXY_SSL_HEADER` is
appropriately set and falls back to `HttpRequest._get_scheme()` (a hook
for subclasses to implement) otherwise.
`WSGIRequest._get_scheme()` makes use of the `wsgi.url_scheme` WSGI
environ variable to determine the request scheme.
`HttpRequest.is_secure()` simply checks if `HttpRequest.scheme` is
`https`.
This provides a way to check the current scheme in templates, for example.
It also allows us to deal with other schemes.
Thanks nslater for the suggestion.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/7603#comment:18>