1
0
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:
idolpx 2021-06-17 17:48:30 -05:00 committed by GitHub
parent 7f78278969
commit 1a5ef71298
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,6 +90,7 @@ bool HTTPClient::begin(WiFiClient &client, const String& url) {
}
String protocol = url.substring(0, index);
protocol.toLowerCase();
if(protocol != "http" && protocol != "https") {
DEBUG_HTTPCLIENT("[HTTP-Client][begin] unknown protocol '%s'\n", protocol.c_str());
return false;
@ -137,6 +138,7 @@ bool HTTPClient::beginInternal(const String& __url, const char* expectedProtocol
}
_protocol = url.substring(0, index);
_protocol.toLowerCase();
url.remove(0, (index + 3)); // remove http:// or https://
if (_protocol == "http") {