Url_scheme not set with https

7 views
Skip to first unread message

Dimitri

unread,
Feb 18, 2010, 1:21:24 PM2/18/10
to isapi_wsgi-dev
Hello all,

I've installed v0.4.1 to play with a IIS 6 + Python 2.6.4 + MoinMoin
1.9 stack.
I've setup a 2 wiki farm and installed the web site as a https:// one.
Most pages worked but sometimes the redirection was to http:// instead
of https://. In addition all generated URLs by the email nortification
system, etc. started with http://
After digging up a little bit into MoinMoin's code, I saw MoinMoin
always get http:// because of the wsgi.url_scheme variable not being
set upon the real protocol used and the getQualifiedURL aka "construct
a full non relative URL" was following the GIGO principle.
I checked IIS Variables' page at http://msdn.microsoft.com/en-us/library/ms524602.aspx
to see how to get the HTTPS yes/no info properly, which happens to
be... HTTPS=on or not


Can anybody tell me if I missed some setting in ISAPI-WSGI or if
there's a better way to set the https info thru the whole stack IIS -
> ISAPI-WSGI -> WSGI than this patch adding HTTPS to the variables'
list being tried by ISAPI-WSGI?

Index: isapi_wsgi.py
===================================================================
--- isapi_wsgi.py (revision 138)
+++ isapi_wsgi.py (working copy)
@@ -418,6 +418,8 @@
# Other useful CGI variables
try:
environ['REMOTE_USER'] = ecb_dict['REMOTE_USER']
+ # DJ - is https used?
+ environ['HTTPS'] = ecb_dict['HTTPS']
except KeyError:
pass

I've tested the hack with the wsgi_test script displaying all
variables known to the environment and the wsgi.url_scheme is now
correctly set, but it sounds strange to me than nobody did run into
this issue as https is quite common.

TIA,
Dimitri.

Reply all
Reply to author
Forward
0 new messages