quetz-mod_python-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Glover <m...@janrain.com>
Subject Bizarre behavior with util.redirect() and mod_autoindex
Date Thu, 14 Sep 2006 17:59:01 GMT

I'm working on an OpenID access control using mod_python.  As part of the OpenID protocol,
our code redirects (302) attempted access to a login page.  Works Great.

However.  If I try to use mod_autoindex to view a directory, and some of the files in that
directory have OpenID access control enabled, I get a page that looks like the attached image.

What's Happening?  mod_autoindex is spawning an internal subrequest for each file in the directory.
 For the access controlled files, util.redirect() is being called as part of that subrequest.
 util.redirect() automatically outputs the 'the document has moved here' language directly
to the client.

I solved this in our app by not generating the 302 if req.main != None.  I don't think I should
have to worry about that (though I'm willing to be convinced).  util.redirect() should recognize
the internal request and not write output to the client.

I'll happily submit a patch against util.py if folks here think it helpful.

-mike

-mike
Mime
View raw message