Skip to content

Commit

Permalink
Use correct host for rate limit
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarneo committed Aug 9, 2021
1 parent 3914729 commit 12bd2a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/decorators/rate-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = fp(async (fastify) => {
const ip = 'do-connecting-ip' in headers ? headers['do-connecting-ip'] : '';

if (ip) {
const shouldRateLimit = await createRateLimit(headers.host);
const shouldRateLimit = await createRateLimit(ip);

if (shouldRateLimit) {
reply.code(429).send({ error: 'Too many requests, please try again later.' });
Expand Down

0 comments on commit 12bd2a8

Please sign in to comment.