From 5423c44142dacc974e3e30ad3dc46fe88ab37a1a Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Mon, 9 Feb 2015 16:21:29 +0000 Subject: Bug 1131036: API searches no longer working --- extensions/BzAPI/bin/rest.cgi | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'extensions/BzAPI') diff --git a/extensions/BzAPI/bin/rest.cgi b/extensions/BzAPI/bin/rest.cgi index 37cbab437..5642ad550 100755 --- a/extensions/BzAPI/bin/rest.cgi +++ b/extensions/BzAPI/bin/rest.cgi @@ -26,6 +26,15 @@ BEGIN { # BzAPI extension functionality Bugzilla->request_cache->{bzapi} = 1; +# Strip trailing slash before attempting match +# otherwise native REST will complain +my $path_info = Bugzilla->cgi->path_info; +if ($path_info =~ s'/$'') { + # Remove first slash as cgi->path_info expects it to + # not be there when setting a new path. + Bugzilla->cgi->path_info(substr($path_info, 1)); +} + use Bugzilla::WebService::Server::REST; Bugzilla->usage_mode(USAGE_MODE_REST); local @INC = (bz_locations()->{extensionsdir}, @INC); -- cgit v1.2.3-24-g4f1b