Skip to content

Commit

Permalink
use uriglob to catch all android captive portal requests (#9041)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu authored Dec 4, 2023
1 parent 9e73cf0 commit 089fe8f
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 089fe8f

Please sign in to comment.