[Zope] - Re: Apache problems

Michel Pelletier michel@digicool.com
Mon, 25 Jan 1999 10:46:12 -0500


Kevin Dangoor wrote:

> On Mon, Jan 25, 1999 at 09:50:33AM -0500, Michel Pelletier wrote:
> ,-----
> | I'm assuming in the [blah blah] you still have the
> | e=HTTP_CGI_AUTHORIZATION:%1? Also,
> | The RewriteCond must come before the Rule, that's what the %1
> | references.
>
> Yup. I left these parts intact.
>
> | Just checking the
> | obvious there, otherwise what I'd suggest is writing a simple script
> | that spits up your
> | environment settings (perl or python will work) and calling that through
> | it's own
> |
> | RewriteRule and see if HTTP_CGI_AUTHORIZATION is even getting set.
>
> I just tried this. Here's what I see:
> REDIRECT_HTTP_CGI_AUTHORIZATION:
> :
>
> I figured that it shouldn't really show a value, since I didn't have
> any kind of password prompt. However, it looks like mod_rewrite added
> a "REDIRECT_" to the front of the header. Is this normal? I didn't
> see an entry for "HTTP_CGI_AUTHORIZATION".

Hmm... I don't know where that REDIRECT_ is coming from, but
ZPublisher won't like it.  Here is the slice of code from ZPublisher.Publish
(lib/python/ZPublisher/Publish.py:line 151)

        if environ.has_key('HTTP_AUTHORIZATION'):
            self.HTTP_AUTHORIZATION=environ['HTTP_AUTHORIZATION']
            try: del environ['HTTP_AUTHORIZATION']
            except: pass
        elif environ.has_key('HTTP_CGI_AUTHORIZATION'):
            self.HTTP_AUTHORIZATION=environ['HTTP_CGI_AUTHORIZATION']
            try: del environ['HTTP_CGI_AUTHORIZATION']
            except: pass

Perhaps we need to add a hack to this hack (with all respect Jim :) to
account for this REDIRECT_  phenomenon.  Just add another 'elif' block
to the end of this like so:

        elif environ.has_key('REDIRECT_HTTP_CGI_AUTHORIZATION'):

self.HTTP_AUTHORIZATION=environ['REDIRECT_HTTP_CGI_AUTHORIZATION']
            try: del environ['REDIRECT_HTTP_CGI_AUTHORIZATION']
            except: pass

This is not graceful, but should work.  I'll plow through the Apache
code to see if there is rhyme or reason here.

-Michel

>
>
> | This
> | is where
> | having a RewriteLog comes in handy, and it tells you what it's setting
> | and when.
> | A possiblity there is to set up your own copy of Zap, have it run as you
> | listening on a high
> | port, and tweak all the rules and settings till you get it to work.  At
> | least there you'll
> | have some idea what the Rewrite Engine is doing.
>
> That's a thought, though that is certainly a lot more involved.
>
> Kevin
>
> --
> Kevin Dangoor