From 0245042a5337d07748ba4b48c7c56a6fa91bbfbe Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Thu, 21 Jun 2018 14:41:22 -0400 Subject: optimize the /bmo/ path fix to not impact runtime performance. --- Bugzilla/Quantum/Plugin/Glue.pm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'Bugzilla/Quantum') diff --git a/Bugzilla/Quantum/Plugin/Glue.pm b/Bugzilla/Quantum/Plugin/Glue.pm index e1c78f07b..112514b63 100644 --- a/Bugzilla/Quantum/Plugin/Glue.pm +++ b/Bugzilla/Quantum/Plugin/Glue.pm @@ -6,6 +6,7 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Quantum::Plugin::Glue; +use 5.10.1; use Mojo::Base 'Mojolicious::Plugin'; use Try::Tiny; @@ -52,18 +53,16 @@ sub register { } ); - $app->hook( - around_dispatch => sub { - my ($next, $c) = @_; - - if ($D{HTTPD_IN_SUBDIR}) { + if ($D{HTTPD_IN_SUBDIR}) { + $app->hook( + before_dispatch => sub { + my ($c) = @_; my $path = $c->req->url->path; $path =~ s{^/bmo}{}s; $c->req->url->path($path); - } - $next->(); - } - ); + } + ); + } Bugzilla::Extension->load_all(); if ($app->mode ne 'development') { -- cgit v1.2.3-24-g4f1b