[Catalyst] Trailing undef in uri_for()

Matt S Trout dbix-class at trout.me.uk
Tue Jun 5 16:12:07 GMT 2007


On Tue, Jun 05, 2007 at 06:20:33AM -0700, Bill Moseley wrote:
> Hum, I can see where a single '' would be useful if you wanted to do:
> 
>     $x = $c->uri_for( '/path', '' );  # include trailing slash
>     $x .= 'foo';                      # for /path/foo
> 
> Although I'm not sure why you wouldn't just use '/foo' in that case.

Nor am I, but for e.g. DAV presence of / is significat.
 
> But,
> 
>     $c->uri_for( '/path', '','' );
> 
> would generate http://localhost/path// which doesn't seem useful.
> Can you think of a case for that?

A varchar primary key that was allowed to be ''

> So, I guess what I'm asking for is to indeed remove trailing empty
> strings.  But, perhaps there's a valid use case for extra and trailing
> slashes I'm not thinking of.
 
Out of luck then, I'm afraid. 
 
> I thought Apache ignored multiple slashes as with these:
> 
>     http://httpd.apache.org/docs/2.2/upgrading.html
>     http://httpd.apache.org/docs/2.2////upgrading.html

That's probably fs-mapped directly.
 
> But different here (images and css)
> 
>     http://apache.org/foundation/contributing.html
>     http://apache.org/foundation///contributing.html

and that not :)

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/             http://www.shadowcatsystems.co.uk/ 



More information about the Catalyst mailing list