From 2a83adb0fd7593069d14e5dbdfa221687972eca5 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 1 Oct 2019 05:23:25 +0200 Subject: [PATCH] Fix setURL() handling of path-only parameters (#6570) The function accidentally compared the current location instead of the passed in (new) location, which didn't match intended logic and the code comment. --- libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp index 6503ea839..61b9a8e4f 100644 --- a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp +++ b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp @@ -536,8 +536,8 @@ void HTTPClient::setTimeout(uint16_t timeout) bool HTTPClient::setURL(String url) { // if the new location is only a path then only update the URI - if (_location.startsWith("/")) { - _uri = _location; + if (url && url[0] == '/') { + _uri = url; clear(); return true; }