fix setCaptivePortalEnable

This commit is contained in:
Shawn A
2018-01-10 10:02:46 -06:00
parent 0897c5800c
commit d7976381e6
3 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -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
View File
@@ -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);