WebThingsIO / webthing-arduino

Simple server for ESP8266, ESP32, Ethernet, or WiFi101-compatible boards compliant with Mozilla's proposed WoT API
Mozilla Public License 2.0
207 stars 78 forks source link

Device Not Addressable Using mDNS Name When Uppercase Letters Are Used #126

Closed kein0r closed 4 years ago

kein0r commented 4 years ago

Hostname is compared as follows in ESPWebThingAdapter.h if (value == name + ".local" || value == ip || value == "localhost") { return true; } This leads to any uppercase or CamelCase hostnames to be rejected because browsers tend toconvert them to lowercase during request. I would suggest changing the code as follows: if (value.equalsIgnoreCase(name + ".local") || value == ip || value == "localhost") { return true; } I believe the same problem exists in EthernetWebThingAdapter.h but couldn't verify that the same fix works there.