From: Matt S Trout Date: Thu, 18 Oct 2012 20:33:58 +0000 (+0000) Subject: handle /- paths X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0ea3d9ae12f326a50c488186a1917b031a791ef9;p=scpubgit%2FApp-SCS.git handle /- paths --- diff --git a/lib/App/SCS/Plugin/Generate/StaticServer.pm b/lib/App/SCS/Plugin/Generate/StaticServer.pm index 4090423..e31b773 100644 --- a/lib/App/SCS/Plugin/Generate/StaticServer.pm +++ b/lib/App/SCS/Plugin/Generate/StaticServer.pm @@ -29,7 +29,7 @@ sub dispatch_request { my ($self) = @_; sub (/**.*) { my $path = $_[1]; - return unless $path =~ s/\/-/\//; + return unless $path =~ s/(?=\/|^)-//; App::SCS::Web::redispatch_to("/static/${path}"); }, sub (/static/...) { $self->_static_handler }, diff --git a/lib/App/SCS/Plugin/Server.pm b/lib/App/SCS/Plugin/Server.pm index 13cf90b..5759c5f 100644 --- a/lib/App/SCS/Plugin/Server.pm +++ b/lib/App/SCS/Plugin/Server.pm @@ -19,7 +19,7 @@ sub page_dispatchers { my ($self) = @_; sub (/**.*) { my $path = $_[1]; - return unless $path =~ s/\/-/\//; + return unless $path =~ s/(?=\/|^)-//; App::SCS::Web::redispatch_to("/static/${path}"); }, sub (/static/...) { $self->_static_handler },