Skip to content

Commit 1a5ef71

Browse files
authored
Change protocol detection so uppercase or lowercase works (#8137)
Make protocol detection case insensitive
1 parent 7f78278 commit 1a5ef71

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ bool HTTPClient::begin(WiFiClient &client, const String& url) {
9090
}
9191

9292
String protocol = url.substring(0, index);
93+
protocol.toLowerCase();
9394
if(protocol != "http" && protocol != "https") {
9495
DEBUG_HTTPCLIENT("[HTTP-Client][begin] unknown protocol '%s'\n", protocol.c_str());
9596
return false;
@@ -137,6 +138,7 @@ bool HTTPClient::beginInternal(const String& __url, const char* expectedProtocol
137138
}
138139

139140
_protocol = url.substring(0, index);
141+
_protocol.toLowerCase();
140142
url.remove(0, (index + 3)); // remove http:// or https://
141143

142144
if (_protocol == "http") {

0 commit comments

Comments
 (0)