Skip to content

Commit 42178b8

Browse files
Append '/' to an URL with empty path instead of returning an error
1 parent 50f1a89 commit 42178b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/HTTPClient/src/HTTPClient.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ bool HTTPClient::beginInternal(String url, const char* expectedProtocol)
262262

263263
index = url.indexOf('/');
264264
if (index == -1) {
265-
log_e("the path of url must not be empty");
266-
return false;
265+
index = url.length();
266+
url += '/';
267267
}
268268
String host = url.substring(0, index);
269269
url.remove(0, index); // remove host part

0 commit comments

Comments
 (0)