Skip to content

Commit

Permalink
fix: remove decimals in header timings (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaunwarman committed May 26, 2020
1 parent 15ccef0 commit 8ed3dec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export function ratelimit(
const n = Math.floor(Number(cur));
let t = Date.now();
t += opts.duration;
t = new Date(t).getTime() / 1000 || 0;
t = Math.floor(new Date(t).getTime() / 1000) || 0;

const headers = {
[remaining]: opts.max - 1,
Expand Down

0 comments on commit 8ed3dec

Please sign in to comment.