summaryrefslogtreecommitdiffstats
path: root/extensions/BzAPI/bin
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2015-02-09 17:21:29 +0100
committerDavid Lawrence <dkl@mozilla.com>2015-02-09 17:21:29 +0100
commit5423c44142dacc974e3e30ad3dc46fe88ab37a1a (patch)
tree23f6b65dad6128b5c98696a1b687d8f38661fc8d /extensions/BzAPI/bin
parent7764fb542aec1b2e6758ef7bd232b9346a63c3fb (diff)
downloadbugzilla-5423c44142dacc974e3e30ad3dc46fe88ab37a1a.tar.gz
bugzilla-5423c44142dacc974e3e30ad3dc46fe88ab37a1a.tar.xz
Bug 1131036: API searches no longer working
Diffstat (limited to 'extensions/BzAPI/bin')
-rwxr-xr-xextensions/BzAPI/bin/rest.cgi9
1 files changed, 9 insertions, 0 deletions
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);