13 May
2014
13 May
'14
6:53 a.m.
On May 12, 2014, at 7:37 PM, Yanick Champoux <yanick@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.