[mod_python] parsed_uri

Ville Silventoinen vsi at ebi.ac.uk
Tue Jun 28 12:47:39 EDT 2005


Hi Nick,

yes, I just found out that if I call:

req.add_common_vars()
for k,v in req.subprocess_env.items():
     req.write("%s=%s\n" % (k,v))

I get all the CGI environment variables. There's "HTTPS=on" and
SERVER_NAME and SERVER_PORT. This solves my problem.

req.unparsed_uri.split(':')[0] returns just "/cgi-bin/vsi/auth/login.py".

Cheers,
Ville


On Tue, 28 Jun 2005, Nick wrote:

> If that's all you need to check, then there are SSL variables in the 
> subprocess_env.  Or, req.unparsed_uri.split(':')[0].
>
> Nick
>
> Ville Silventoinen wrote:
>> Hi,
>> 
>> has anyone used req.parsed_uri fields successfully?
>> 
>>   def handler(req):
>>       req.content_type = "text/plain"
>>       for field in req.parsed_uri:
>>           req.write("%s," % str(field))
>>       return apache.OK
>> 
>> shows following:
>> 
>>   None,None,None,None,None,None,/cgi-bin/vsi/auth/login.py,None,None,
>> 
>> Is there any other way to determine scheme, host and port?
>> Or to get the original URL? I need to check that scheme is 'https'...
>> 
>> Thanks,
>> Ville
>> 
>> 
>> _______________________________________________
>> Mod_python mailing list
>> Mod_python at modpython.org
>> http://mailman.modpython.org/mailman/listinfo/mod_python
>
>


More information about the Mod_python mailing list