use parent qw(ModPerl::Registry);
use Bugzilla;
+use Bugzilla::Constants qw(USAGE_MODE_REST);
sub handler : method {
my $class = shift;
use warnings;
Bugzilla::init_page();
- return $class->SUPER::handler(@_);
+ my $result = $class->SUPER::handler(@_);
+
+ # When returning data from the REST api, tell Apache not to append its
+ # error html documents to the response.
+ return Bugzilla->usage_mode == USAGE_MODE_REST
+ ? Apache2::Const::OK
+ : $result;
}