Skip to content

Commit e5a1192

Browse files
dbuhasenradball
authored andcommitted
use uriglob to catch all android captive portal requests (esp8266#9041)
1 parent a0fd1b7 commit e5a1192

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <DNSServer.h>
55
#include <ESP8266mDNS.h>
66
#include <EEPROM.h>
7+
#include <uri/UriGlob.h>
78

89
/*
910
This example serves a "hello world" on a WLAN and a SoftAP at the same time.
@@ -74,8 +75,8 @@ void setup() {
7475
server.on("/", handleRoot);
7576
server.on("/wifi", handleWifi);
7677
server.on("/wifisave", handleWifiSave);
77-
server.on("/generate_204", handleRoot); // Android captive portal. Maybe not needed. Might be handled by notFound handler.
78-
server.on("/fwlink", handleRoot); // Microsoft captive portal. Maybe not needed. Might be handled by notFound handler.
78+
server.on(UriGlob("/generate_204*"), handleRoot); // Android captive portal. Handle "/generate_204_<uuid>"-like requests. Might be handled by notFound handler.
79+
server.on("/fwlink", handleRoot); // Microsoft captive portal. Maybe not needed. Might be handled by notFound handler.
7980
server.onNotFound(handleNotFound);
8081
server.begin(); // Web server start
8182
Serial.println("HTTP server started");

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy