mirror of
https://github.com/discourse/discourse.git
synced 2025-01-04 12:03:47 +08:00
20 lines
273 B
Ruby
20 lines
273 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
module RequestTracker
|
||
|
module RateLimiters
|
||
|
class IP < Base
|
||
|
def rate_limit_key
|
||
|
"ip/#{@request.ip}"
|
||
|
end
|
||
|
|
||
|
def rate_limit_globally?
|
||
|
true
|
||
|
end
|
||
|
|
||
|
def active?
|
||
|
true
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|