From 7007fdb327ded4e1ba20e4bb5b60069fdb3f0af2 Mon Sep 17 00:00:00 2001 From: raomin <4460208+raomin@users.noreply.github.com> Date: Thu, 13 Jul 2023 19:04:16 +0200 Subject: [PATCH] Limited redirect --- WiFiManager.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/WiFiManager.cpp b/WiFiManager.cpp index 7ae05b0ac..1f58982c6 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -2420,6 +2420,15 @@ boolean WiFiManager::captivePortal() { bool doredirect = serverLoc != server->hostHeader(); // redirect if hostheader not server ip, prevent redirect loops // doredirect = !isIp(server->hostHeader()) // old check + //Only redirect the portal detection requests. Avoids overload. + doredirect = doredirect + && (server->hostHeader().indexOf("connect")>=0 + || server->hostHeader().indexOf("msft")>=0 + || server->hostHeader().indexOf("apple")>=0 + || server->uri().startsWith("/gen") + || server->uri().indexOf("hostpot")>=0 + ); + if (doredirect) { #ifdef WM_DEBUG_LEVEL DEBUG_WM(DEBUG_VERBOSE,F("<- Request redirected to captive portal"));