summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mod_perl.pl8
1 files changed, 7 insertions, 1 deletions
diff --git a/mod_perl.pl b/mod_perl.pl
index 73ba4bd9e..740348887 100644
--- a/mod_perl.pl
+++ b/mod_perl.pl
@@ -139,7 +139,13 @@ sub handler : method {
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 substr($0, -9) eq '/rest.cgi'
+ ? Apache2::Const::OK
+ : $result;
}