derby has asked for the wisdom of the Perl Monks concerning the following question:
I have a rather obscure (to me) problem. I'm working on a prototype with mod_perl and am running into an issue with progogating path_info. Here's a general overview of the prototype:
A URL such as http://www.myserver.com/app/id should default to http://www.myserver.com/app/id/step_one. I have a fixup handler on app that handles this correctly (??? - in that step_one is added to path_info).
The HTML generated contains a real generic form action - "step_two."
Here's the issue, when invoked as http://www.myserver.com/app/id/step_one - the id is propogated and step_two is invoked properly (/app/id/step_two); however, when invoked as http://www.myserver.com/app/id, the id is not propogated and the action is incorrectly invoked (/app/step_two).
I'm not sure what to set in the fixup handler to properly propogate the id when modifying the path info. Below is the the handler.
sub handler { my $r = shift; my( $id, $step ) = (split( /\//, $r->path_info ))[1,2]; if( ! $step ) { $step = "step_one"; # Seems to have no bearing on $ENV{REQUEST_URI} my $ruri = $r->uri . "/" . $step; $r->uri( $ruri ); $r->subprocess_env( REQUEST_URI => $ruri ); $ENV{REQUEST_URI} = $ruri; # Modify path_info my $pinfo = $r->path_info . "/" . $step; $r->path_info( $pinfo ); $r->subprocess_env( PATH_INFO => $pinfo ); $ENV{PATH_INFO} = $pinfo; } ....
Of course, this is a problem with my not understanding how a relative url is properly resolved (and where in the apache lifecycle I can influence it). I also tried setting SCRIPT_URI, SCRIPT_NAME and SCRIPT_URL via subprocess_env and ENV mangling.
Any ideas?
-derby
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: mod_perl and propogating path_info
by derby (Abbot) on Mar 27, 2003 at 15:49 UTC | |
|
Re: mod_perl and propogating path_info
by perrin (Chancellor) on Mar 27, 2003 at 18:35 UTC | |
by derby (Abbot) on Mar 27, 2003 at 20:16 UTC | |
by perrin (Chancellor) on Mar 27, 2003 at 20:48 UTC | |
|
Re: mod_perl and propogating path_info
by Lhamo Latso (Scribe) on Mar 27, 2003 at 19:08 UTC |