Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change protocol detection so uppercase or lowercase works #8137

Merged
merged 3 commits into from
Jun 17, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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") {
Expand Down