Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fbbfc34

Browse files
committedMar 24, 2024
fix(wifi): correct matching requests made from browsers
Example Message Exchange: https://www.rfc-editor.org/rfc/rfc9110.html#section-3.9
1 parent f9bb62a commit fbbfc34

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎libraries/WiFi/examples/SimpleWiFiServer/SimpleWiFiServer.ino

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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)
Please sign in to comment.