From: Matt S Trout Date: Mon, 14 Nov 2011 16:34:48 +0000 (+0000) Subject: redispatch /-foo/ style static URLs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=99295c1bbeb640bd3e3bcfaec891949fcf398000;p=scpubgit%2FSCS.git redispatch /-foo/ style static URLs --- diff --git a/lib/SCSite/DevMode.pm b/lib/SCSite/DevMode.pm index e33ab23..f02dd89 100644 --- a/lib/SCSite/DevMode.pm +++ b/lib/SCSite/DevMode.pm @@ -17,6 +17,11 @@ around dispatch_request => sub { my ($orig, $self) = (shift, shift); no warnings::illegalproto; ( + sub (/**.*) { + my ($self, $path) = @_; + return unless $path =~ s/\/-/\//; + SCSite::redispatch_to "/static/${path}"; + }, sub (/static/...) { $self->_static_handler }, sub (/favicon + .ico) { $self->_static_handler }, $self->$orig(@_)