1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-22 21:23:07 +03:00

Merge pull request #1398 from dpeckett/malformed-uri-scheme-handling

Fix typo causing crash on missing uri scheme
This commit is contained in:
Markus 2016-01-10 13:10:47 +01:00
commit 95cf0553e4

View File

@ -107,7 +107,7 @@ void HTTPClient::begin(String url, String httpsFingerprint) {
int index = url.indexOf(':'); int index = url.indexOf(':');
//int index2; //int index2;
bool hasPort = false; bool hasPort = false;
if(index) { if(index >= 0) {
protocol = url.substring(0, index); protocol = url.substring(0, index);
url.remove(0, (index + 3)); // remove http:// or https:// url.remove(0, (index + 3)); // remove http:// or https://