Re: [mp2] Changing response code after access phase

2004-07-21 Thread Stas Bekman
Rob Bloodgood wrote: Friday, July 16, 2004, 5:31:35 PM, you wrote: SB> Ah, sorry, I'm lost in the sea of methods hahaha I know the feeling. SB> -- I think we have exactly SB> what you want. It should appear in here: SB> http://perl.apache.org/docs/2.0/api/Apache/HookRun.html This was the key I need

Re: [mp2] Changing response code after access phase

2004-07-16 Thread Stas Bekman
Geoffrey Young wrote: I would investigate other methods before trying this (such as the ideas Stas had), but the short answer is that yes, you can call core functions directly. see recipe 8.9 in the mod_perl developer's cookbook. http://www.modperlcookbook.org/code/ch08/Cookbook/MIMEMagic.pm Ah,

Re: [mp2] Changing response code after access phase

2004-07-16 Thread Geoffrey Young
>> I would investigate other methods before trying this (such as the >> ideas Stas >> had), but the short answer is that yes, you can call core functions >> directly. see recipe 8.9 in the mod_perl developer's cookbook. >> >> http://www.modperlcookbook.org/code/ch08/Cookbook/MIMEMagic.pm > >

Re: [mp2] Changing response code after access phase

2004-07-16 Thread Stas Bekman
Geoffrey Young wrote: Well then my next question then becomes: is it possible with mod_perl to hook into other modules' calls (I'm trying to not duplicate all of mod_access, merely change the return value)? eg along the lines of: sub handler { my $r = shift; if ($r->api_call('check_dir_access') =

Re: [mp2] Changing response code after access phase

2004-07-16 Thread Geoffrey Young
> Well then my next question then becomes: is it possible with mod_perl > to hook into other modules' calls (I'm trying to not duplicate all of > mod_access, merely change the return value)? > > eg along the lines of: > > sub handler { > my $r = shift; > if ($r->api_call('check_dir_access')

Re: [mp2] Changing response code after access phase

2004-07-16 Thread Stas Bekman
I think an easy workaround in this case is to reset all the future handlers that may have been run, dynamically register a custom response handler, where you do the redirect, return OK for the access phase and you are done. -- __ S

Re: [mp2] Changing response code after access phase

2004-07-16 Thread Stas Bekman
Stas Bekman wrote: Try: use Apache::Response (); use Apache::Const -compile => qw(FORBIDDEN); sub handler { $r->custom_response(Apache::FORBIDDEN, $url); ... } Ah, no, that will just change the body of the response, not the HTTP status (still 403). -- _

Re: [mp2] Changing response code after access phase

2004-07-16 Thread Stas Bekman
Rob Bloodgood wrote: Friday, July 16, 2004, 12:54:06 PM, you wrote: GY> Rob Bloodgood wrote: I'm using mod_access for Allow/Deny, and on Deny it of course responds to the client with FORBIDDEN. I've experimented with using a fixup handler to change this to a REDIRECT, GY> I don't see how that cou

Re: [mp2] Changing response code after access phase

2004-07-16 Thread Geoffrey Young
Rob Bloodgood wrote: > I'm using mod_access for Allow/Deny, and on Deny it of course responds > to the client with FORBIDDEN. I've experimented with using a fixup > handler to change this to a REDIRECT, I don't see how that could happen - once you return something other than OK, DECLINED, or DO