aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ruppert <idl0r@gentoo.org>2015-07-11 15:27:33 +0200
committerChristian Ruppert <idl0r@gentoo.org>2015-07-11 15:27:33 +0200
commit4b2ce2725e9a4525e273fb1b08243aad74770a3d (patch)
treec90fb0fef5c9ac923817f908f1c3586efa47ec59 /mod_perl.pl
parentBumped version to 4.4.9 (diff)
downloadbugzilla-4b2ce2725e9a4525e273fb1b08243aad74770a3d.tar.gz
bugzilla-4b2ce2725e9a4525e273fb1b08243aad74770a3d.tar.bz2
bugzilla-4b2ce2725e9a4525e273fb1b08243aad74770a3d.zip
Vanilla 4.4.9 to 5.0 without history due to massive merge conflicts
Diffstat (limited to 'mod_perl.pl')
-rw-r--r--mod_perl.pl24
1 files changed, 21 insertions, 3 deletions
diff --git a/mod_perl.pl b/mod_perl.pl
index ae15ae5fc..bdce744ca 100644
--- a/mod_perl.pl
+++ b/mod_perl.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -wT
+#!/usr/bin/perl -T
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
@@ -7,6 +7,8 @@
# defined by the Mozilla Public License, v. 2.0.
package Bugzilla::ModPerl;
+
+use 5.10.1;
use strict;
use warnings;
@@ -107,9 +109,14 @@ foreach my $file (glob "$cgi_path/*.cgi") {
}
package Bugzilla::ModPerl::ResponseHandler;
+
+use 5.10.1;
use strict;
-use base qw(ModPerl::Registry);
+use warnings;
+
+use parent qw(ModPerl::Registry);
use Bugzilla;
+use Bugzilla::Constants qw(USAGE_MODE_REST);
sub handler : method {
my $class = shift;
@@ -127,12 +134,23 @@ sub handler : method {
use warnings;
Bugzilla::init_page();
- return $class->SUPER::handler(@_);
+ my $result = $class->SUPER::handler(@_);
+
+ # When returning data from the REST api we must only return 200 or 304,
+ # which tells Apache not to append its error html documents to the
+ # response.
+ return Bugzilla->usage_mode == USAGE_MODE_REST && $result != 304
+ ? Apache2::Const::OK
+ : $result;
}
package Bugzilla::ModPerl::CleanupHandler;
+
+use 5.10.1;
use strict;
+use warnings;
+
use Apache2::Const -compile => qw(OK);
sub handler {