Skip to content

Commit

Permalink
Bug 1893698 - Remove the cache-friendly redirect from / to /home that…
Browse files Browse the repository at this point in the history
… originally addressed a DoS from Firefox version 52
  • Loading branch information
dklawren committed Apr 26, 2024
1 parent 71c7cb3 commit d95c7d7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 51 deletions.
2 changes: 0 additions & 2 deletions Bugzilla/App.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use Bugzilla::Logging;
use Bugzilla::App::API;
use Bugzilla::App::BouncedEmails;
use Bugzilla::App::CGI;
use Bugzilla::App::Main;
use Bugzilla::App::OAuth2::Provider::Clients;
use Bugzilla::App::SES;
use Bugzilla::App::Static;
Expand Down Expand Up @@ -210,7 +209,6 @@ sub setup_routes {
Bugzilla::App::API->setup_routes($r);
Bugzilla::App::BouncedEmails->setup_routes($r);
Bugzilla::App::CGI->setup_routes($r);
Bugzilla::App::Main->setup_routes($r);
Bugzilla::App::OAuth2::Provider::Clients->setup_routes($r);
Bugzilla::App::SES->setup_routes($r);
Bugzilla::App::BMO::AntiSpam->setup_routes($r);
Expand Down
16 changes: 16 additions & 0 deletions Bugzilla/App/CGI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ sub setup_routes {
$class->load_one($name, $file);
$r->any("/$file")->to("CGI#$name");
}

$r->any('/')->to('CGI#index_cgi');
$r->any('/home')->to('CGI#index_cgi');

$r->any('/bug/<id:num>')->to('CGI#show_bug_cgi');
Expand All @@ -48,6 +50,20 @@ sub setup_routes {
$c->res->code(301);
$c->redirect_to(Bugzilla->localconfig->basepath . 'enter_bug.cgi');
});

$r->get('/testagent.cgi' => sub { shift->render(text => 'OK Mojolicious')});

$r->add_type('hex32' => qr/[[:xdigit:]]{32}/);
$r->post('/announcement/hide/<checksum:hex32>')->to('CGI#announcement_hide');
}

sub announcement_hide {
my ($self) = @_;
my $checksum = $self->param('checksum');
if ($checksum && $checksum =~ /^[[:xdigit:]]{32}$/) {
$self->session->{announcement_checksum} = $checksum;
}
$self->render(json => {});
}

sub load_one {
Expand Down
47 changes: 0 additions & 47 deletions Bugzilla/App/Main.pm

This file was deleted.

2 changes: 0 additions & 2 deletions template/en/default/main/root.html.tmpl

This file was deleted.

0 comments on commit d95c7d7

Please sign in to comment.