diff --git a/libraries/WiFi/examples/SimpleWiFiServer/SimpleWiFiServer.ino b/libraries/WiFi/examples/SimpleWiFiServer/SimpleWiFiServer.ino index 1867533662c..b5797305ce0 100644 --- a/libraries/WiFi/examples/SimpleWiFiServer/SimpleWiFiServer.ino +++ b/libraries/WiFi/examples/SimpleWiFiServer/SimpleWiFiServer.ino @@ -99,10 +99,10 @@ void loop(){ } // Check to see if the client request was "GET /H" or "GET /L": - if (currentLine.endsWith("GET /H")) { + if (currentLine.startsWith("GET /H")) { digitalWrite(5, HIGH); // GET /H turns the LED on } - if (currentLine.endsWith("GET /L")) { + if (currentLine.startsWith("GET /L")) { digitalWrite(5, LOW); // GET /L turns the LED off } } diff --git a/libraries/WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino b/libraries/WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino index 6c113fe48b9..c713085f976 100644 --- a/libraries/WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino +++ b/libraries/WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino @@ -84,10 +84,10 @@ void loop() { } // Check to see if the client request was "GET /H" or "GET /L": - if (currentLine.endsWith("GET /H")) { + if (currentLine.startsWith("GET /H")) { digitalWrite(LED_BUILTIN, HIGH); // GET /H turns the LED on } - if (currentLine.endsWith("GET /L")) { + if (currentLine.startsWith("GET /L")) { digitalWrite(LED_BUILTIN, LOW); // GET /L turns the LED off } }