]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1461819 - Plack::Handler::Apache2 accidentally unsets $ENV{MOD_PERL}
authorDylan William Hardison <dylan@hardison.net>
Tue, 22 May 2018 18:43:07 +0000 (14:43 -0400)
committerGitHub <noreply@github.com>
Tue, 22 May 2018 18:43:07 +0000 (14:43 -0400)
.htaccess
Bugzilla/ModPerl.pm
helper.psgi [deleted file]

index 4c7e3bd206ed83b3fa0ebcc12b687254a4c82fcd..ee7d296b0460d33162182ff7d8dac6d692356302 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -12,6 +12,8 @@ Redirect permanent /bug_status.html https://bugzilla.mozilla.org/page.cgi?id=fie
 Redirect permanent /bugwritinghelp.html https://bugzilla.mozilla.org/page.cgi?id=bug-writing.html
 Redirect permanent /etiquette.html https://bugzilla.mozilla.org/page.cgi?id=etiquette.html
 Redirect permanent /duplicates.html https://bugzilla.mozilla.org/duplicates.cgi
+Redirect permanent /quicksearch.html https://bugzilla.mozilla.org/page.cgi?id=quicksearch.html
+Redirect permanent /bugwritinghelp.html https://bugzilla.mozilla.org/page.cgi?id=bug-writing.html
 
 RewriteEngine On
 # This rewrite rule skips over the rest, which is good because the load balancers
@@ -27,8 +29,6 @@ RewriteRule ^__version__$ version.json [L]
 # heartbeat.cgi returns 200 if the DB and memcached are both working, and 500 otherwise.
 RewriteRule ^__heartbeat__$ heartbeat.cgi [L]
 
-RewriteRule ^(\d+|quicksearch\.html|bugwritinghelp\.html)$ /helper/$1 [L]
-
 RewriteRule ^static/v\d{4}\d{2}\d{2}\.\d+/(.+\.(?:js|css|woff2?|png|jpe?g|gif|ico|svg))$ $1 [NC,E=IMMUTABLE:1,L]
 Header set Cache-Control "public, max-age=31536000" env=REDIRECT_IMMUTABLE
 
@@ -42,6 +42,7 @@ RewriteRule ^template_cache.deleteme/ - [F,L,NC]
 RewriteRule ^review$ page.cgi?id=splinter.html$1 [QSA]
 RewriteRule ^user_?profile$ page.cgi?id=user_profile.html$1 [QSA]
 RewriteRule ^request_defer$ page.cgi?id=request_defer.html$1 [QSA]
+RewriteRule ^([0-9]+)$ show_bug.cgi?id=$1 [QSA]
 RewriteRule ^favicon\.ico$ extensions/BMO/web/images/favicon.ico
 RewriteRule ^form[\.:]itrequest$ enter_bug.cgi?product=Infrastructure+\%26+Operations&format=itrequest [QSA]
 RewriteRule ^form[\.:](mozlist|poweredby|presentation|trademark|recoverykey)$ enter_bug.cgi?product=mozilla.org&format=$1 [QSA]
index 120dd82102185bf419136f3b8cc726be188b6120..89eca95853639745c5ec20ce709c3a7af547dc34 100644 (file)
@@ -86,12 +86,6 @@ ErrorDocument 403 /errors/403.html
 ErrorDocument 404 /errors/404.html
 ErrorDocument 500 /errors/500.html
 
-<Location /helper>
-    SetHandler perl-script
-    PerlResponseHandler Plack::Handler::Apache2
-    PerlSetVar psgi_app [% cgi_path %]/helper.psgi
-</Location>
-
 <Directory "[% cgi_path %]">
     AddHandler perl-script .cgi
     # No need to PerlModule these because they're already defined in mod_perl.pl
diff --git a/helper.psgi b/helper.psgi
deleted file mode 100644 (file)
index cc8c648..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/perl
-# 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/.
-#
-# This Source Code Form is "Incompatible With Secondary Licenses", as
-# defined by the Mozilla Public License, v. 2.0.
-
-use 5.10.1;
-use strict;
-use warnings;
-use Plack::Request;
-use Plack::Response;
-
-my $app = sub {
-    my $env     = shift;
-    my $req     = Plack::Request->new($env);
-    my $res     = Plack::Response->new(404);
-    my $urlbase = Bugzilla->localconfig->{urlbase};
-    my $path    = $req->path;
-
-    if ( $path eq '/quicksearch.html' ) {
-        $res->redirect( $urlbase . 'page.cgi?id=quicksearch.html', 301 );
-    }
-    elsif ( $path eq '/bugwritinghelp.html') {
-        $res->redirect( $urlbase . 'page.cgi?id=bug-writing.html', 301 );
-    }
-    elsif ( $path =~ m{^/(\d+)$}s ) {
-        $res->redirect( $urlbase . "show_bug.cgi?id=$1", 301 );
-    }
-    else {
-        $res->body('not found');
-    }
-    return $res->finalize;
-};
\ No newline at end of file