mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-04 02:48:13 +10:00
add workaround for #1543
@etoten thanks, slight change, Might have to add ipv6 detection instead and handle it that way
This commit is contained in:
@@ -2416,6 +2416,16 @@ boolean WiFiManager::captivePortal() {
|
||||
if(!_enableCaptivePortal) return false; // skip redirections, @todo maybe allow redirection even when no cp ? might be useful
|
||||
|
||||
String serverLoc = toStringIp(server->client().localIP());
|
||||
|
||||
// fallback for ipv6 bug
|
||||
if(serverloc = 0.0.0.0){
|
||||
if ((WiFi.status()) != WL_CONNECTED)
|
||||
serverLoc = toStringIp(WiFi.softAPIP());
|
||||
else
|
||||
serverLoc = toStringIp(WiFi.localIP());
|
||||
}
|
||||
}
|
||||
|
||||
if(_httpPort != 80) serverLoc += ":" + (String)_httpPort; // add port if not default
|
||||
bool doredirect = serverLoc != server->hostHeader(); // redirect if hostheader not server ip, prevent redirect loops
|
||||
|
||||
|
||||
Reference in New Issue
Block a user