mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-23 13:58:09 -05:00
Revert "Ratelimits: add strict enforcement mode."
This reverts commit 6b73de5dd5758d7a6df07ad85668af21afb510f8.
This commit is contained in:
@@ -296,9 +296,6 @@ RL_OAUTH_SITEWIDE_ENABLED = true
|
||||
RL_OAUTH_RESET_MINUTES = 10
|
||||
RL_OAUTH_AVG_REQ_PER_SEC = 0.5
|
||||
|
||||
# should we get rid of the non-api / cdn exemptions for ratelimits?
|
||||
RL_STRICT_ENFORCEMENT = false
|
||||
|
||||
# user agent substrings to hard-ratelimit to a number of requests per ten second period
|
||||
# example: agents = googlebot:10, appengine:2
|
||||
agents =
|
||||
|
||||
@@ -980,11 +980,6 @@ class MinimalController(BaseController):
|
||||
client_id = c.oauth2_access_token.client_id.encode("ascii")
|
||||
# OAuth2 ratelimits are per user-app combination
|
||||
key = 'siterl-oauth-' + c.user._id36 + ":" + client_id
|
||||
elif g.RL_STRICT_ENFORCEMENT:
|
||||
type_ = "strict"
|
||||
max_reqs = g.RL_MAX_REQS
|
||||
period = g.RL_RESET_SECONDS
|
||||
key = "siterl-strict-" + request.ip
|
||||
elif c.cdn_cacheable:
|
||||
type_ = "cdn"
|
||||
elif not is_api():
|
||||
|
||||
@@ -227,7 +227,6 @@ class Globals(object):
|
||||
'ENFORCE_RATELIMIT',
|
||||
'RL_SITEWIDE_ENABLED',
|
||||
'RL_OAUTH_SITEWIDE_ENABLED',
|
||||
'RL_STRICT_ENFORCEMENT',
|
||||
],
|
||||
|
||||
ConfigValue.tuple: [
|
||||
|
||||
Reference in New Issue
Block a user