Commit ca9d0d91 authored by Byron Jones's avatar Byron Jones

Bug 895306: REST endpoint returns both JSON and HTML errors when running under mod_perl

r=dkl, a=glob
parent 2034689f
......@@ -115,6 +115,7 @@ use strict;
use parent qw(ModPerl::Registry);
use Bugzilla;
use Bugzilla::Constants qw(USAGE_MODE_REST);
sub handler : method {
my $class = shift;
......@@ -132,7 +133,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 Bugzilla->usage_mode == USAGE_MODE_REST
? Apache2::Const::OK
: $result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment