From ddae2e468e894f2723132923ab524da1ed9c7cbf Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Sun, 25 Aug 2024 12:38:15 +0200 Subject: [PATCH] Fix `Cannot assign to "currentMiddleware" because it is a constant` error. --- src/handlers/requestHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/handlers/requestHandler.js b/src/handlers/requestHandler.js index 395e311..11311fd 100644 --- a/src/handlers/requestHandler.js +++ b/src/handlers/requestHandler.js @@ -709,7 +709,7 @@ function requestHandler(req, res) { // Call the next middleware function const next = () => { - const currentMiddleware = middleware[index++]; + let currentMiddleware = middleware[index++]; while (req.isProxy && currentMiddleware && !currentMiddleware.proxySafe) { currentMiddleware = middleware[index++]; }