mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-13 14:51:21 +10:00
fix setCaptivePortalEnable
This commit is contained in:
+2
-2
@@ -585,7 +585,7 @@ void WiFiManager::handleWifi(boolean scan) {
|
||||
server->send(200, "text/html", page);
|
||||
// server->close(); // testing reliability fix for content length mismatches during mutiple flood hits
|
||||
|
||||
Serial.println(page);
|
||||
// Serial.println(page);
|
||||
|
||||
DEBUG_WM(F("Sent config page"));
|
||||
}
|
||||
@@ -1158,7 +1158,7 @@ void WiFiManager::handleNotFound() {
|
||||
boolean WiFiManager::captivePortal() {
|
||||
DEBUG_WM("-> " + server->hostHeader());
|
||||
|
||||
if(!_enableCaptivePortal) return true; // skip redirections
|
||||
if(!_enableCaptivePortal) return false; // skip redirections
|
||||
|
||||
if (!isIp(server->hostHeader())) {
|
||||
DEBUG_WM(F("<- Request redirected to captive portal"));
|
||||
|
||||
+1
-1
@@ -150,7 +150,7 @@ class WiFiManager
|
||||
void setRestorePersistent(boolean persistent);
|
||||
//if true, always show static net inputs, IP, subnet, gateway, if false, only show when already set.
|
||||
void setShowStaticFields(boolean alwaysShow);
|
||||
|
||||
//if true disable captive portal redirection
|
||||
void setCaptivePortalEnable(boolean enabled);
|
||||
|
||||
private:
|
||||
|
||||
@@ -42,6 +42,8 @@ void loop() {
|
||||
//WITHOUT THIS THE AP DOES NOT SEEM TO WORK PROPERLY WITH SDK 1.5 , update to at least 1.5.1
|
||||
//WiFi.mode(WIFI_STA);
|
||||
|
||||
wifiManager.setCaptivePortalEnable(false);
|
||||
|
||||
if (!wifiManager.startConfigPortal("OnDemandAP")) {
|
||||
Serial.println("failed to connect and hit timeout");
|
||||
delay(3000);
|
||||
|
||||
Reference in New Issue
Block a user