Skip to content

Commit 42a599d

Browse files
committed
Fix setURL() handling of path-only parameters
The function accidentally compared the current location instead of the passed in (new) location, which didn't match intended logic and the code comment.
1 parent ffe5476 commit 42a599d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,8 @@ void HTTPClient::setTimeout(uint16_t timeout)
536536
bool HTTPClient::setURL(String url)
537537
{
538538
// if the new location is only a path then only update the URI
539-
if (_location.startsWith("/")) {
540-
_uri = _location;
539+
if (url && url[0] == '/') {
540+
_uri = url;
541541
clear();
542542
return true;
543543
}

0 commit comments

Comments
 (0)