Opened 16 years ago

Closed 13 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: no

Description

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 django.http.init.py and the PyISAPIe patch is against django.core.handlers.pysiapi.py. We're using Django trunk r8066.

Some extra information is available on my blog.

Attachments (2)

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

Download all attachments as: .zip

Change History (9)

by KayEss, 16 years ago

Attachment: django.patch added

Django patch

by KayEss, 16 years ago

Attachment: pyisapie.patch added

PyISAPIe patch

comment:1 by Malcolm Tredinnick, 16 years ago

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 by Malcolm Tredinnick, 16 years ago

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 by (none), 15 years ago

milestone: post-1.0

Milestone post-1.0 deleted

comment:4 by afternoon, 14 years ago

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 by Luke Plant, 13 years ago

Severity: Normal
Type: New feature

comment:6 by ayaz@…, 13 years ago

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.

Thanks.

comment:7 by Luke Plant, 13 years ago

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/wsgi.py for an example.

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