Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
liberty
host
Smilodon
Commits
dda9ac92
Commit
dda9ac92
authored
Nov 25, 2016
by
Eugen Rochko
Browse files
Fix reset date format when rate limited
parent
4495baf4
Changes
1
Hide whitespace changes
Inline
Side-by-side
config/initializers/rack-attack.rb
View file @
dda9ac92
...
...
@@ -11,7 +11,7 @@ class Rack::Attack
headers
=
{
'X-RateLimit-Limit'
=>
match_data
[
:limit
].
to_s
,
'X-RateLimit-Remaining'
=>
'0'
,
'X-RateLimit-Reset'
=>
(
now
+
(
match_data
[
:period
]
-
now
.
to_i
%
match_data
[
:period
])).
to_s
'X-RateLimit-Reset'
=>
(
now
+
(
match_data
[
:period
]
-
now
.
to_i
%
match_data
[
:period
])).
iso8601
(
6
)
}
[
429
,
headers
,
[{
error:
'Throttled'
}.
to_json
]]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment