summaryrefslogtreecommitdiffstats
path: root/extensions/BzAPI
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/BzAPI')
-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);