ramkrishanbhatt / modwsgi

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

Pass HTTP_COOKIE data to WSGIAccessScript #160

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It would be great if cookie data was included in the environ parameter
given to the 'allow_access' function.

Looking through the mod_wsgi.c code, it looks like you construct a
Auth_environ PyObject that only passes through specific headers
(Content-Length, Content-Type, etc.). I guess that it would be possible to
add the "Cookie" header as "HTTP_COOKIE" in a similar way.

The use case I have for this is to restrict access to static media based
upon the user having a particular cookie set (i.e. auth token).

It's only cookies that I personally would need to access. However, I
imagine it could be handy to have other headers available such as
User-Agent and Referer, which could be used as a basis for
granting/blocking access. Would it be feasible to have all the headers
available as per the environ parameter to the 'application' WSGI function?

Original issue reported on code.google.com by fras...@gmail.com on 15 Oct 2009 at 2:22

GoogleCodeExporter commented 8 years ago
Use mod_wsgi 3.0 release candidate as it already passes headers to auth 
functions. Change will not be back 
ported to 2.X.

Original comment by Graham.Dumpleton@gmail.com on 15 Oct 2009 at 10:33