diff --git a/libraries/HTTPClient/src/HTTPClient.cpp b/libraries/HTTPClient/src/HTTPClient.cpp index e7a8ecb8f4f..cc0a31e2b6b 100644 --- a/libraries/HTTPClient/src/HTTPClient.cpp +++ b/libraries/HTTPClient/src/HTTPClient.cpp @@ -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