summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService
diff options
context:
space:
mode:
authorMary Umoh <umohm12@gmail.com>2017-06-30 01:03:46 +0200
committerDylan William Hardison <dylan@hardison.net>2017-07-07 00:19:20 +0200
commit4c9f9a8c49e9f25096ee3b6982b197e9efa6dd60 (patch)
tree21fd41e87f0838321f4494f784fd94bc1f1b679f /Bugzilla/WebService
parent662b0801c0e429b7d83c2ad6ed47a0293f10ff5e (diff)
downloadbugzilla-4c9f9a8c49e9f25096ee3b6982b197e9efa6dd60.tar.gz
bugzilla-4c9f9a8c49e9f25096ee3b6982b197e9efa6dd60.tar.xz
Bug 1355169 - Add rate-limiting to show_bug.cgi and rest.cgi
* fix mistake * Update * Updates * remove other file
Diffstat (limited to 'Bugzilla/WebService')
-rw-r--r--Bugzilla/WebService/Bug.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index 78545e129..97dd46d0e 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -22,7 +22,7 @@ use Bugzilla::WebService::Constants;
use Bugzilla::WebService::Util qw(extract_flags filter filter_wants validate translate);
use Bugzilla::Bug;
use Bugzilla::BugMail;
-use Bugzilla::Util qw(trick_taint trim detaint_natural);
+use Bugzilla::Util qw(trick_taint trim detaint_natural remote_ip);
use Bugzilla::Version;
use Bugzilla::Milestone;
use Bugzilla::Status;
@@ -398,6 +398,9 @@ sub _translate_comment {
sub get {
my ($self, $params) = validate(@_, 'ids');
+ unless (Bugzilla->user->id) {
+ Bugzilla->check_rate_limit("get_bug", remote_ip());
+ }
Bugzilla->switch_to_shadow_db() unless Bugzilla->user->id;
my $ids = $params->{ids};