[Maypole] URL reconstruction

Jesse Sheidlower jester@panix.com
Wed, 5 May 2004 11:59:31 -0400


On Wed, May 05, 2004 at 06:10:34AM +0100, Simon Cozens wrote:
> Jesse Sheidlower:
> > The authentication doc page discusses how to reconstruct the URL
> > in a template, like so:
> > 
> > [% SET args = request.args.join("/"); %]
> > ...
> > <FORM ACTION="[% base %]/[%request.table%]/[% request.action %]/[%args%]">
> > 
> > So that one can, for example, take a detour to a login page and go
> > back to where you came from.
> 
> [% request.path %] is the new way of doing things. It's in the manual
> somewhere, but should probably be made explicit in a Request chapter recipe.

Ah, that is a nice way of doing things. And I see it is in the Request
chapter on exactly what I'm asking about, the pass-through login feature.
(See, that's what you get for having a whole bunch of different docs! Some
will be out of date; I was looking at the Authentication how-to.)

However, there seems to be a problem, which is that request.path only
contains the URL, without the parameters. And looking at the code, that
seems to be what it is meant to contain--isn't this, in A::MVC's
parse_location, meant to strip the params out of the $r->{path} entirely?

  $self->{path} =~ s/^($loc)?\///;

Thus [% request.path %] won't actually contain the full path, and this
suggestion in the pass-through login thing won't work.

Jesse Sheidlower