From 316da617fb27e57974f42b5a73f1c7618a5f3106 Mon Sep 17 00:00:00 2001 From: Dongil Seo Date: Fri, 1 Jul 2022 15:49:21 +0900 Subject: [PATCH] Fix ip whitelist middleware location --- client/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/index.js b/client/index.js index 7193827fc..ad3ea84f7 100755 --- a/client/index.js +++ b/client/index.js @@ -31,7 +31,6 @@ const middleware = new Middleware(); app.use(middleware.expressJsonRequestBodySizeLimiter()); app.use(middleware.expressUrlencdedRequestBodySizeLimiter()); app.use(middleware.corsLimiter()); -app.use(middleware.ipWhitelistLimiter()); app.use(middleware.blockchainApiRateLimiter); const eventHandler = NodeConfigs.ENABLE_EVENT_HANDLER === true ? new EventHandler() : null; @@ -112,6 +111,9 @@ app.get('/last_block_number', (req, res, next) => { .end(); }); +// NOTE(platfowner): This middleware should be placed after minimally required APIs (see above). +app.use(middleware.ipWhitelistLimiter()); + /** * Dev Client GET APIs (available to whitelisted IPs) */