Skip to content

Commit d90b22e

Browse files
committed
fix(wifi): correct matching requests made from browsers
Check: https://www.rfc-editor.org/rfc/rfc9110.html#section-3.9 for _Example Message Exchange_.
1 parent f9bb62a commit d90b22e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

libraries/WiFi/examples/SimpleWiFiServer/SimpleWiFiServer.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ void loop(){
9999
}
100100

101101
// Check to see if the client request was "GET /H" or "GET /L":
102-
if (currentLine.endsWith("GET /H")) {
102+
if (currentLine.startsWith("GET /H")) {
103103
digitalWrite(5, HIGH); // GET /H turns the LED on
104104
}
105-
if (currentLine.endsWith("GET /L")) {
105+
if (currentLine.startsWith("GET /L")) {
106106
digitalWrite(5, LOW); // GET /L turns the LED off
107107
}
108108
}

libraries/WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ void loop() {
8484
}
8585

8686
// Check to see if the client request was "GET /H" or "GET /L":
87-
if (currentLine.endsWith("GET /H")) {
87+
if (currentLine.startsWith("GET /H")) {
8888
digitalWrite(LED_BUILTIN, HIGH); // GET /H turns the LED on
8989
}
90-
if (currentLine.endsWith("GET /L")) {
90+
if (currentLine.startsWith("GET /L")) {
9191
digitalWrite(LED_BUILTIN, LOW); // GET /L turns the LED off
9292
}
9393
}

0 commit comments

Comments
 (0)