Copterfly / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

Add HTTP headers into environment passed to aaa hook functions. #69

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The access/authentication/authorisation hook functions are not currently passed 
HTTP request 
headers. Thus, header such as HTTP_USER_AGENT not available, which people want 
to often use to 
change how authentication is managed. Since there seems to be no harm in adding 
these, should 
add them. Only exceptions would be HTTP_AUTHORIZATION, HTTP_CONTENT_TYPE and 
HTTP_CONTENT_LENGTH.

For how this should be implemented, see ap_add_common_vars() in 
server/util_script.c of Apache 
source code.

Original issue reported on code.google.com by Graham.Dumpleton@gmail.com on 26 Mar 2008 at 9:50

GoogleCodeExporter commented 8 years ago
The simplest thing probably is to temporarily replace r->subprocess_env with 
new table object and call ap_add_common_vars(). 
Then construct dictionary and put back r->subprocess_env.

If doing that, may as well pass through the full WSGI environ that handler 
gets. So, also call ap_add_cgi_vars() as well.

There is other stuff as well which is done in wsgi_build_environment(), related 
to SCRIPT_NAME and PATH_INFO though. The values 
for these at auth stage may technically be different to what handler may get 
and why they had been left out for now.

Original comment by Graham.Dumpleton@gmail.com on 29 Oct 2008 at 11:03

GoogleCodeExporter commented 8 years ago
Constructing environment into separate table would mean existing entries in 
table left by some other module 
would be ignored. Should actually make copy. Question is what would be able to 
set subprocess_env entries at 
that point. Can mod_rewrite do it at early Apache phases?

Original comment by Graham.Dumpleton@gmail.com on 29 Oct 2008 at 11:08

GoogleCodeExporter commented 8 years ago
HTTP headers now passed in CGI style in revision 1123 of trunk.

Original comment by Graham.Dumpleton@gmail.com on 21 Nov 2008 at 9:40

GoogleCodeExporter commented 8 years ago

Original comment by Graham.Dumpleton@gmail.com on 6 Feb 2009 at 1:54

GoogleCodeExporter commented 8 years ago
Version 3.0 of mod_wsgi now released with this change.

Original comment by Graham.Dumpleton@gmail.com on 22 Nov 2009 at 2:51