quetz-mod_python-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Graham Dumpleton" <grah...@dscpl.com.au>
Subject Re: Bizarre behavior with util.redirect() and mod_autoindex
Date Thu, 14 Sep 2006 23:29:24 GMT
Sorry for spamming the list with so many quick messages, I'll stop
now. One more question first though.

How are you causing the PythonHandler to be triggered? Are you
using SetHandler/AddHandler or some other configuration. It would
help perhaps if you post your actual Apache configuration snippet
for the directory concerned.

Graham

Graham Dumpleton wrote ..
> If you are using PythonHandler then and not an earlier phase, I don't
> understand why your handler is being called in the first place then for
> those files. Which means of creating a sub request is mod_autoindex
> using? I was presuming that it would be using the means of doing a
> sub request which only runs up to the fixup handler phase and would
> not actually run the response handler itself. This would ensure that
> any access, authentication, authorisation, type matching stuff would
> be done which I would have thought been enough for mod_autoindex
> to get the information it may want. After all, why would it need the
> actual content to be returned as it would muck up the results as you
> are seeing.
> 
> Looking up the code I actually see that mod_autoindex is using the
> function ap_sub_req_lookup_uri() which as I suspects, shouldn't result
> in the response handler itself being run. Thus, your PythonHandler
> shouldn't be getting called as a result of mod_autoindex.
> 
> There thus has to be something else which is causing your handler
> to be triggered.
> 
> Mike Glover wrote ..
> > Graham-
> > 
> > Thanks for the reply.
> > 
> > I have DirectoryIndex inherited from httpd.conf.
> > 
> > The handler is a PythonHandler.
> > 
> > Read the link you sent later -- I'm not clueful enough yet to know if
> that's
> > biting me (it seems to only apply to the earlier handlers, no?) -- but
> > yes,  we are running 3.2.10.
> > 
> > -mike
> > 
> > On Thu, 14 Sep 2006 18:05:56 -0400
> > "Graham Dumpleton" <grahamd@dscpl.com.au> wrote:
> > 
> > > Do you have the DirectoryIndex directive defined explicitly or inherited
> > > from outer scope? What handler phase are you defining your mod_python
> > > handler in?
> > > 
> > > Graham
> > > 
> > > Mike Glover wrote ..
> > > > 
> > > > 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