Skip to content

Commit

Permalink
fix: more aggressive rate limit (#1051)
Browse files Browse the repository at this point in the history
Way too many requests coming from unknown clients. This will make sure
clients identify themselves with a user-agent.
  • Loading branch information
styfle authored Jun 20, 2024
1 parent b5f1e28 commit fc3b43e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function handler(req: IncomingMessage, res: ServerResponse) {
userAgent.startsWith('got')
) {
botCount++;
if (botCount % 10 === 0) {
if (botCount % 2 === 0) {
res.statusCode = 429;
res.end(
'Too many requests from unknown user-agent. See https://github.com/styfle/packagephobia/blob/main/API.md',
Expand Down

0 comments on commit fc3b43e

Please sign in to comment.