forked from espressif/arduino-esp32
Append '/' to an URL with empty path in HTTPClient::begin (#5634)
* Add an error check for empty path of an URL * Append '/' to an URL with empty path instead of returning an error
This commit is contained in:
@ -261,6 +261,10 @@ bool HTTPClient::beginInternal(String url, const char* expectedProtocol)
|
||||
url.remove(0, (index + 3)); // remove http:// or https://
|
||||
|
||||
index = url.indexOf('/');
|
||||
if (index == -1) {
|
||||
index = url.length();
|
||||
url += '/';
|
||||
}
|
||||
String host = url.substring(0, index);
|
||||
url.remove(0, index); // remove host part
|
||||
|
||||
|
Reference in New Issue
Block a user