﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24463	Remove old functionality from `HttpRequest`	Rik	nobody	"The `scheme()` method on `HttpRequest` returns the scheme the request was on, so http or https. If you look at the implementation of the method:

https://github.com/django/django/blob/master/django/http/request.py#L163

You see that it checks a Django setting and if that doesn't result in https, it falls back to the `_get_scheme()` method.

Now if you look at the `_get_scheme()` method:

https://github.com/django/django/blob/master/django/http/request.py#L159

You see it checks if the environment variable ""HTTPS"" is set to ""on"". I think is old functionality that doesn't belong in Django anymore. It was probably from the time mod_python was used. These days this functionality is implemented by WSGI:

https://www.python.org/dev/peps/pep-3333/#environ-variables

(search for HTTPS=on)

Also the WSGI handler in Django overwrites the `_get_scheme()`:

https://github.com/django/django/blob/master/django/core/handlers/wsgi.py#L115

And since every HTTP request in Django goes through WSGI, the `_get_scheme()` method in `HttpRequest` would never be used.

So I think we should remove this functionality from `HttpRequest`, to prevent confusion, because when I stumbled upon this piece of code it confused me quite a bit and it took me some time to find out what it might be."	Cleanup/optimization	closed	HTTP handling	dev	Normal	fixed			Unreviewed	1	0	0	0	0	0
