Skip to content

Instantly share code, notes, and snippets.

Created November 15, 2016 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/820c612389519e5ed58a4656f653606c to your computer and use it in GitHub Desktop.
Save anonymous/820c612389519e5ed58a4656f653606c to your computer and use it in GitHub Desktop.
--- a/Mojolicious.pm
+++ b/Mojolicious.pm
@@ -88,6 +88,8 @@ sub defaults { Mojo::Util::_stash(defaul
sub dispatch {
my ($self, $c) = @_;
+ $c->{tx}->{req}->{url}->{path}->{path} =~ s|/{2,}|/|og;
+
my $plugins = $self->plugins->emit_hook(before_dispatch => $c);
# Try to find a static file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment