fixes #1764, removes login prereq for api suage
This commit is contained in:
@@ -16,11 +16,6 @@ class ApplicationController < ActionController::Base
|
|||||||
protected
|
protected
|
||||||
def api_check
|
def api_check
|
||||||
if request.format.to_s =~ /\/json|\/xml/
|
if request.format.to_s =~ /\/json|\/xml/
|
||||||
if CurrentUser.is_anonymous?
|
|
||||||
render :text => "403 Forbidden\n", :layout => false, :status => 403
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
if ApiLimiter.throttled?(request.remote_ip)
|
if ApiLimiter.throttled?(request.remote_ip)
|
||||||
render :text => "421 User Throttled\n", :layout => false, :status => 421
|
render :text => "421 User Throttled\n", :layout => false, :status => 421
|
||||||
return false
|
return false
|
||||||
|
|||||||
Reference in New Issue
Block a user