diff options
author | Byron Jones <bjones@mozilla.com> | 2013-07-18 10:01:43 +0200 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2013-07-18 10:01:43 +0200 |
commit | 2e44b36b22fb0304a3798ccfd7b5af87ae943258 (patch) | |
tree | 484d56a44986cae789736fe079cad321a29e529c | |
parent | 86f01e74bf94131853d4b42b5e2da1ad804851aa (diff) | |
download | bugzilla-2e44b36b22fb0304a3798ccfd7b5af87ae943258.tar.gz bugzilla-2e44b36b22fb0304a3798ccfd7b5af87ae943258.tar.xz |
Bug 895306: REST endpoint returns both JSON and HTML errors when running under mod_perl
-rw-r--r-- | mod_perl.pl | 8 |
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; } |