summaryrefslogtreecommitdiffstats
path: root/mod_perl.pl
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-07-18 10:01:43 +0200
committerByron Jones <bjones@mozilla.com>2013-07-18 10:01:43 +0200
commit2e44b36b22fb0304a3798ccfd7b5af87ae943258 (patch)
tree484d56a44986cae789736fe079cad321a29e529c /mod_perl.pl
parent86f01e74bf94131853d4b42b5e2da1ad804851aa (diff)
downloadbugzilla-2e44b36b22fb0304a3798ccfd7b5af87ae943258.tar.gz
bugzilla-2e44b36b22fb0304a3798ccfd7b5af87ae943258.tar.xz
Bug 895306: REST endpoint returns both JSON and HTML errors when running under mod_perl
Diffstat (limited to 'mod_perl.pl')
-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;
}