On May 12, 2014, at 7:37 PM, Yanick Champoux <yan...@babyl.dyndns.org> wrote:

> On 14-05-12 01:24 PM, Warren Young wrote:
>> can I ask Dancer to ignore trailing slashes?
> 
> hook before => sub {
>     my $url = request->uri;
>     redirect $url if $url =~ s#(?<=.)/$##;
> };

I’m guessing the only reason you have that lookbehind in there is to prevent 
the substitution from breaking the top-level ‘/‘ route?

Also, is there anything wrong with using “forward” here instead of “redirect”?  
I’d rather save the HTTP round-trip and not “correct” the browser, as my app 
really does not care.
_______________________________________________
dancer-users mailing list
dancer-users@dancer.pm
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users

Reply via email to