work on #2693 Separate API Limits by Writes/Reads

This commit is contained in:
Albert Yi
2016-10-17 16:27:03 -07:00
parent ced7a34afa
commit 87447a51c3
3 changed files with 41 additions and 16 deletions

View File

@@ -41,7 +41,7 @@ protected
def api_check
if request.format.to_s =~ /\/json|\/xml/ || params[:controller] == "iqdb"
if ApiLimiter.throttled?(request.remote_ip)
if ApiLimiter.throttled?(request.remote_ip, request.request_method)
render :text => "421 User Throttled\n", :layout => false, :status => 421
return false
end