Skip to content

Commit

Permalink
use uriglob to catch all android captive portal requests (esp8266#9041)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu authored and hasenradball committed Nov 18, 2024
1 parent a0fd1b7 commit e5a1192
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <DNSServer.h>
#include <ESP8266mDNS.h>
#include <EEPROM.h>
#include <uri/UriGlob.h>

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

0 comments on commit e5a1192

Please sign in to comment.