mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: rate limiter text is confusing, should not say daily
Also, adds easily parseable JSON so users can figure out how long to wait when the API is limited. ("extras" "wait_seconds")
This commit is contained in:
@ -107,7 +107,7 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
|
||||
def render_rate_limit_error(e)
|
||||
render_json_error e.description, type: :rate_limit, status: 429
|
||||
render_json_error e.description, type: :rate_limit, status: 429, extras: { wait_seconds: e&.available_in }
|
||||
end
|
||||
|
||||
# If they hit the rate limiter
|
||||
|
Reference in New Issue
Block a user