From: Dylan William Hardison Date: Tue, 16 Oct 2018 21:33:58 +0000 (-0400) Subject: Bug 1482644 - Improve "Too many requests" page with an explaination X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10ebcd3520af5767fe28cbe892615c60e10d12e3;p=thirdparty%2Fbugzilla.git Bug 1482644 - Improve "Too many requests" page with an explaination --- diff --git a/Bugzilla/Quantum/Plugin/BlockIP.pm b/Bugzilla/Quantum/Plugin/BlockIP.pm index 974eebff9..c464fe49e 100644 --- a/Bugzilla/Quantum/Plugin/BlockIP.pm +++ b/Bugzilla/Quantum/Plugin/BlockIP.pm @@ -35,8 +35,7 @@ sub _before_routes { $c->block_ip($ip); $c->res->code(429); $c->res->message('Too Many Requests'); - $c->res->body('Too Many Requests'); - $c->finish; + $c->render(handler => 'bugzilla', template => 'global/ip-blocked', block_timeout => BLOCK_TIMEOUT); } } diff --git a/template/en/default/global/ip-blocked.html.tmpl b/template/en/default/global/ip-blocked.html.tmpl new file mode 100644 index 000000000..b60ea41ea --- /dev/null +++ b/template/en/default/global/ip-blocked.html.tmpl @@ -0,0 +1,15 @@ +[% PROCESS global/variables.none.tmpl %] + +[% title = "Too Many Requests" %] + +[% PROCESS global/header.html.tmpl + robots = 'noindex' %] + +

[% title FILTER html %]

+ +

+ We’re sorry, but you have sent too many requests to us recently. + You will be unblocked in [% block_timeout / 60 FILTER none %] minutes. +

+ +[% PROCESS global/footer.html.tmpl %]