mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
Change protocol detection so uppercase or lowercase works (#8137)
Make protocol detection case insensitive
This commit is contained in:
parent
7f78278969
commit
1a5ef71298
@ -90,6 +90,7 @@ bool HTTPClient::begin(WiFiClient &client, const String& url) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String protocol = url.substring(0, index);
|
String protocol = url.substring(0, index);
|
||||||
|
protocol.toLowerCase();
|
||||||
if(protocol != "http" && protocol != "https") {
|
if(protocol != "http" && protocol != "https") {
|
||||||
DEBUG_HTTPCLIENT("[HTTP-Client][begin] unknown protocol '%s'\n", protocol.c_str());
|
DEBUG_HTTPCLIENT("[HTTP-Client][begin] unknown protocol '%s'\n", protocol.c_str());
|
||||||
return false;
|
return false;
|
||||||
@ -137,6 +138,7 @@ bool HTTPClient::beginInternal(const String& __url, const char* expectedProtocol
|
|||||||
}
|
}
|
||||||
|
|
||||||
_protocol = url.substring(0, index);
|
_protocol = url.substring(0, index);
|
||||||
|
_protocol.toLowerCase();
|
||||||
url.remove(0, (index + 3)); // remove http:// or https://
|
url.remove(0, (index + 3)); // remove http:// or https://
|
||||||
|
|
||||||
if (_protocol == "http") {
|
if (_protocol == "http") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user