Skip to content

Commit

Permalink
Don't rate limit Googlebot
Browse files Browse the repository at this point in the history
  • Loading branch information
feross committed Nov 18, 2021
1 parent 45b6366 commit 180e637
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ export default function init () {
max: 30,
headers: false,
handler: (req, res, next) => {
// Don't rate limit Googlebot
if (req.headers['user-agent']?.toLowerCase().includes('google')) {
next()
return
}
rateLimitLogger(req, res, () => {})
res.status(503).send('Blocked for too many requests')
}
Expand Down

0 comments on commit 180e637

Please sign in to comment.