From 8b54dc1e1ada823d5e6c655f295e52602681226b Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Tue, 22 May 2018 14:43:07 -0400 Subject: Bug 1461819 - Plack::Handler::Apache2 accidentally unsets $ENV{MOD_PERL} --- .htaccess | 5 +++-- Bugzilla/ModPerl.pm | 6 ------ helper.psgi | 35 ----------------------------------- 3 files changed, 3 insertions(+), 43 deletions(-) delete mode 100644 helper.psgi diff --git a/.htaccess b/.htaccess index 4c7e3bd20..ee7d296b0 100644 --- 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] diff --git a/Bugzilla/ModPerl.pm b/Bugzilla/ModPerl.pm index 120dd8210..89eca9585 100644 --- a/Bugzilla/ModPerl.pm +++ b/Bugzilla/ModPerl.pm @@ -86,12 +86,6 @@ ErrorDocument 403 /errors/403.html ErrorDocument 404 /errors/404.html ErrorDocument 500 /errors/500.html - - SetHandler perl-script - PerlResponseHandler Plack::Handler::Apache2 - PerlSetVar psgi_app [% cgi_path %]/helper.psgi - - 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 index cc8c648a8..000000000 --- a/helper.psgi +++ /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 -- cgit v1.2.3-24-g4f1b