mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-29 23:29:04 +01:00
Add Content-Type header on throttled response to fix mojibake (#4558)
application/json only allows Unicode, so this prevents from wrong charset detection.
This commit is contained in:
parent
c9fd6f386c
commit
b42c018bb8
1 changed files with 1 additions and 0 deletions
|
@ -33,6 +33,7 @@ class Rack::Attack
|
||||||
match_data = env['rack.attack.match_data']
|
match_data = env['rack.attack.match_data']
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
|
'Content-Type' => 'application/json',
|
||||||
'X-RateLimit-Limit' => match_data[:limit].to_s,
|
'X-RateLimit-Limit' => match_data[:limit].to_s,
|
||||||
'X-RateLimit-Remaining' => '0',
|
'X-RateLimit-Remaining' => '0',
|
||||||
'X-RateLimit-Reset' => (now + (match_data[:period] - now.to_i % match_data[:period])).iso8601(6),
|
'X-RateLimit-Reset' => (now + (match_data[:period] - now.to_i % match_data[:period])).iso8601(6),
|
||||||
|
|
Loading…
Reference in a new issue