-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Bug 1893698 - Remove the cache-friendly redirect from / to /h…
…ome that originally addressed a DoS from Firefox version 52" This reverts commit d95c7d7.
- Loading branch information
Showing
4 changed files
with
51 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# 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. | ||
|
||
package Bugzilla::App::Main; | ||
use Mojo::Base 'Mojolicious::Controller'; | ||
|
||
use Bugzilla::Error; | ||
use Try::Tiny; | ||
use Bugzilla::Constants; | ||
|
||
sub setup_routes { | ||
my ($class, $r) = @_; | ||
|
||
$r->any('/')->to('Main#root'); | ||
|
||
$r->get('/testagent.cgi')->to('Main#testagent'); | ||
|
||
$r->add_type('hex32' => qr/[[:xdigit:]]{32}/); | ||
$r->post('/announcement/hide/<checksum:hex32>')->to('Main#announcement_hide'); | ||
} | ||
|
||
sub root { | ||
my ($c) = @_; | ||
$c->res->headers->cache_control('public, max-age=3600, immutable'); | ||
$c->stash('urlbase', Bugzilla->localconfig->urlbase); | ||
$c->render(handler => 'bugzilla'); | ||
} | ||
|
||
sub testagent { | ||
my ($self) = @_; | ||
$self->render(text => "OK Mojolicious"); | ||
} | ||
|
||
sub announcement_hide { | ||
my ($self) = @_; | ||
my $checksum = $self->param('checksum'); | ||
if ($checksum && $checksum =~ /^[[:xdigit:]]{32}$/) { | ||
$self->session->{announcement_checksum} = $checksum; | ||
} | ||
$self->render(json => {}); | ||
} | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[% SET home_url = c.stash.urlbase _ 'home' %] | ||
[% PROCESS index.html.tmpl meta_refresh="0;URL='$home_url'" %] |