From 180e63775c1a6e2985ae2a919c9bd60ef9c5c9bd Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 18 Nov 2021 01:48:27 -0800 Subject: [PATCH] Don't rate limit Googlebot --- src/server/app.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/app.js b/src/server/app.js index c857aa1..0661e39 100644 --- a/src/server/app.js +++ b/src/server/app.js @@ -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') }