]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1482644 - Improve "Too many requests" page with an explaination
authorDylan William Hardison <dylan@hardison.net>
Tue, 16 Oct 2018 21:33:58 +0000 (17:33 -0400)
committerGitHub <noreply@github.com>
Tue, 16 Oct 2018 21:33:58 +0000 (17:33 -0400)
Bugzilla/Quantum/Plugin/BlockIP.pm
template/en/default/global/ip-blocked.html.tmpl [new file with mode: 0644]

index 974eebff98003ea6b5b58729822026341f029221..c464fe49ec90a459c3c5319a26ede05b2c65ab15 100644 (file)
@@ -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 (file)
index 0000000..b60ea41
--- /dev/null
@@ -0,0 +1,15 @@
+[% PROCESS global/variables.none.tmpl %]
+
+[% title = "Too Many Requests" %]
+
+[% PROCESS global/header.html.tmpl
+           robots = 'noindex' %]
+
+<h1>[% title FILTER html %]</h1>
+
+<p>
+    We’re sorry, but you have sent too many requests to us recently.
+    You will be unblocked in [% block_timeout / 60 FILTER none %] minutes.
+</p>
+
+[% PROCESS global/footer.html.tmpl %]