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
4495baf4
Commit
4495baf4
authored
Nov 25, 2016
by
Eugen Rochko
Browse files
X-RateLimit-Reset formatted with iso8601
parent
898ab66e
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/controllers/api_controller.rb
View file @
4495baf4
...
...
@@ -48,7 +48,7 @@ class ApiController < ApplicationController
response
.
headers
[
'X-RateLimit-Limit'
]
=
match_data
[
:limit
].
to_s
response
.
headers
[
'X-RateLimit-Remaining'
]
=
(
match_data
[
:limit
]
-
match_data
[
:count
]).
to_s
response
.
headers
[
'X-RateLimit-Reset'
]
=
(
now
+
(
match_data
[
:period
]
-
now
.
to_i
%
match_data
[
:period
])).
to_s
response
.
headers
[
'X-RateLimit-Reset'
]
=
(
now
+
(
match_data
[
:period
]
-
now
.
to_i
%
match_data
[
:period
])).
iso8601
(
6
)
end
def
set_pagination_headers
(
next_path
=
nil
,
prev_path
=
nil
)
...
...
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