summaryrefslogtreecommitdiffstats
path: root/extensions/BzAPI/lib/Resources/Bugzilla.pm
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2014-08-26 21:45:40 +0200
committerDavid Lawrence <dkl@mozilla.com>2014-08-26 21:45:40 +0200
commitb888aaa25fd0775e022e196ed8f56e766e766098 (patch)
treed7dbd977106816c113a3e3740c07dc0274743b5a /extensions/BzAPI/lib/Resources/Bugzilla.pm
parentbfc1cfe2b6f723b260d90363b7eccbb8e3297f89 (diff)
downloadbugzilla-b888aaa25fd0775e022e196ed8f56e766e766098.tar.gz
bugzilla-b888aaa25fd0775e022e196ed8f56e766e766098.tar.xz
Bug 1057774: bzAPI landing page gives a 404
Diffstat (limited to 'extensions/BzAPI/lib/Resources/Bugzilla.pm')
-rw-r--r--extensions/BzAPI/lib/Resources/Bugzilla.pm20
1 files changed, 20 insertions, 0 deletions
diff --git a/extensions/BzAPI/lib/Resources/Bugzilla.pm b/extensions/BzAPI/lib/Resources/Bugzilla.pm
index 6c436e861..26aae0849 100644
--- a/extensions/BzAPI/lib/Resources/Bugzilla.pm
+++ b/extensions/BzAPI/lib/Resources/Bugzilla.pm
@@ -17,6 +17,9 @@ use Bugzilla::Keyword;
use Bugzilla::Product;
use Bugzilla::Status;
use Bugzilla::Field;
+use Bugzilla::Util qw(correct_urlbase);
+
+use Bugzilla::Extension::BzAPI::Constants;
use Digest::MD5 qw(md5_base64);
@@ -27,10 +30,18 @@ use Digest::MD5 qw(md5_base64);
BEGIN {
require Bugzilla::WebService::Bugzilla;
*Bugzilla::WebService::Bugzilla::get_configuration = \&get_configuration;
+ *Bugzilla::WebService::Bugzilla::get_empty = \&get_empty;
}
sub rest_handlers {
my $rest_handlers = [
+ qr{^/$}, {
+ GET => {
+ resource => {
+ method => 'get_empty'
+ }
+ }
+ },
qr{^/configuration$}, {
GET => {
resource => {
@@ -115,4 +126,13 @@ sub get_configuration {
return $result;
}
+sub get_empty {
+ my ($self) = @_;
+ return {
+ urlbase => $self->type('string', correct_urlbase() . "bzapi/"),
+ documentation => $self->type('string', BZAPI_DOC),
+ version => $self->type('string', BUGZILLA_VERSION)
+ };
+}
+
1;