From 26dc6be76356bfe0cc2ad64cd89f429158d7870d Mon Sep 17 00:00:00 2001 From: teddit Date: Sun, 28 Mar 2021 07:16:00 +0200 Subject: [PATCH] check if config.rate_limiting exists --- routes.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/routes.js b/routes.js index 950aa8e..19dc109 100644 --- a/routes.js +++ b/routes.js @@ -13,6 +13,10 @@ module.exports = (app, redis, fetch, RedditAPI) => { let processSubredditsExplore = require('./inc/processSubredditsExplore.js')(); app.all('*', (req, res, next) => { + if(!config.rate_limiting) { + return next() + } + if(config.rate_limiting.enabled) { /** * This route enforces request limits based on an IP address if