From 1a5ef712986f369772f17d0ffad9413eea798f73 Mon Sep 17 00:00:00 2001 From: idolpx Date: Thu, 17 Jun 2021 17:48:30 -0500 Subject: [PATCH] Change protocol detection so uppercase or lowercase works (#8137) Make protocol detection case insensitive --- libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp index f16167127..4400414e6 100644 --- a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp +++ b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp @@ -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") {