[Catalyst] Handling arguments with Reges vs the meaning of paths

Bill Moseley moseley at hank.org
Fri Jan 6 19:59:31 CET 2006

On Fri, Jan 06, 2006 at 02:43:52PM +0100, A. Pagaltzis wrote:
> * Bill Moseley <moseley at hank.org> [2006-01-06 07:45]:
> >I'm not sure I'm clear what you are saying.  Why not just ignore
> >the arguments?
> >
> >It's how the CGI standard works and all the other actions work.
> >Why should the Regex matching be different?
> No, it???s not. They???re path segments, not parameters. There is an
> RFC that defines how URIs are interpreted; you should look at it
> at sometime.

Oh, I should, yes.

In the context of CGI the path segments after the script are placed in
PATH_INFO.  In the context of Catalyst, the script is the "action" and
the PATH_INFO becomes the arguments.

> Among other things, returning 200 for URLs with random
> discardable bits means that bots such as such search engine
> spiders may go on a wild goose chase, fetching different-
> looking-but-not-actually-different URLs all day long without
> knowing any better.

Spider's don't make up URLs to follow, they follow links.  So that's
only going to happen if you are putting up invalid links.

If you don't want to allow extra segments after the action then it's
easy to check @args and deal with it as you like.

> If you want such URLs to produce a result rather than just 404,
> then they should redirect to the canonical URL. I???ve written
> about the considerations in
>     Transparent opaque changeable permanent URLs
>     <http://plasmasturm.org/log/358/>

Then what should a request for an invalid article do?

    $ HEAD http://plasmasturm.org/log/3583329393/
    200 OK

Bill Moseley
moseley at hank.org

More information about the Catalyst mailing list