aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ruppert <idl0r@gentoo.org>2015-07-11 16:08:11 +0200
committerChristian Ruppert <idl0r@gentoo.org>2015-07-11 16:08:11 +0200
commitbf1988c8169ed4c5c50eb8bfda1dd2736d39cb33 (patch)
tree077237f351d9f9bb5616ce7b2edb8187e29715c3 /mod_perl.pl
parentRemove files no longer kept in the upstream repo (diff)
parentVanilla 4.4.9 to 5.0 without history due to massive merge conflicts (diff)
downloadbugzilla-bf1988c8169ed4c5c50eb8bfda1dd2736d39cb33.tar.gz
bugzilla-bf1988c8169ed4c5c50eb8bfda1dd2736d39cb33.tar.bz2
bugzilla-bf1988c8169ed4c5c50eb8bfda1dd2736d39cb33.zip
Merge branch '4.4.9-to-5.0-vanilla-nohist' into 5.0-migration
Move @gentoo.org restriction for new accounts into the Gentoo extentions. Reset some templates to vanilla/default. We'll use custom ones from now on
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 3f563417f..5c5ed82ff 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;
@@ -108,9 +110,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;
@@ -128,12 +135,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 {