From 2e44b36b22fb0304a3798ccfd7b5af87ae943258 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Thu, 18 Jul 2013 16:01:43 +0800 Subject: Bug 895306: REST endpoint returns both JSON and HTML errors when running under mod_perl --- mod_perl.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'mod_perl.pl') 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; } -- cgit v1.2.3-24-g4f1b