Opened 10 years ago

Closed 7 years ago

#8281 closed New feature (wontfix)

Django running ounder PyISAPIe on IIS doesn't detect HTTPS

Reported by: KayEss Owned by: nobody
Component: HTTP handling Version: 1.0-alpha
Severity: Normal Keywords: PyISAPIe HTTPS
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX:


The is_secure() function in django.http.Request uses os.environ to detect whether or not the request is HTTPS or not. This doesn't work on Windows because the environment doesn't contain this information.

PyISAPIe makes this information available in META (well, actually it doesn't yet, but that's another bug and patch to file against PyISAPIe).

The Django patch is against and the PyISAPIe patch is against We're using Django trunk r8066.

Some extra information is available on my blog.

Attachments (2)

django.patch (524 bytes) - added by KayEss 10 years ago.
Django patch
pyisapie.patch (931 bytes) - added by KayEss 10 years ago.
PyISAPIe patch

Download all attachments as: .zip

Change History (9)

Changed 10 years ago by KayEss

Attachment: django.patch added

Django patch

Changed 10 years ago by KayEss

Attachment: pyisapie.patch added

PyISAPIe patch

comment:1 Changed 10 years ago by Malcolm Tredinnick

milestone: 1.0
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

It's looks like this could be done without adding two extra lines of code: always call lower() on the environment value. The PyISAPIe patch is irrelevant and shouldn't really have been attached here. That's not part of Django (and whoever is distributing it as a third-party handler shouldn't be putting it in the django.core.handlers namespace).

comment:2 Changed 10 years ago by Malcolm Tredinnick

milestone: 1.0post-1.0

Pushing to after 1.0, since this is really a feature addition and depends upon a feature that doesn't even exist yet in the thing we're being asked to accommodate.

comment:3 Changed 9 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

comment:4 Changed 8 years ago by afternoon

I'd like to nudge this bug. I'm using PyISAPIe in production, have experienced the issue and have used KayEss's patch successfully.

comment:5 Changed 7 years ago by Luke Plant

Severity: Normal
Type: New feature

comment:6 Changed 7 years ago by ayaz@…

Easy pickings: unset

Hello everyone:

I'd like to give this a gentle push.

If I may ask, is there any chance this could make it into trunk? This ticket was opened three years ago. I recently deployed multiple Django web applications on IIS7 using PyISAPIe and got bitten by this bug.


comment:7 Changed 7 years ago by Luke Plant

Resolution: wontfix
Status: newclosed

I can't see any reason why this needs to be in Django, rather than in your PyASPIe handler (which I have no access to - it's not part of Django and I can't find it). Look at WSGIRequest in django/core/handlers/ for an example.

Note: See TracTickets for help on using tickets.
Back to Top