Skip to content

Commit

Permalink
Change Date.toGMTString to Date.toUTCString due to deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypfer committed Feb 15, 2021
1 parent 19b8c24 commit 9a665ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/express-rate-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function RateLimit(options) {
res.setHeader("X-RateLimit-Remaining", req.rateLimit.remaining);
if (resetTime instanceof Date) {
// if we have a resetTime, also provide the current date to help avoid issues with incorrect clocks
res.setHeader("Date", new Date().toGMTString());
res.setHeader("Date", new Date().toUTCString());
res.setHeader(
"X-RateLimit-Reset",
Math.ceil(resetTime.getTime() / 1000)
Expand Down

0 comments on commit 9a665ab

Please sign in to comment.