From ef4458839bc447959adb82538e63200f84528cc8 Mon Sep 17 00:00:00 2001 From: Chris Liebman Date: Mon, 27 Jan 2020 16:37:16 -0800 Subject: [PATCH] clear _canReuse in setUrl if its not a local redirect --- libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp index 422dd3a0c0..c3f6107fca 100644 --- a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp +++ b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp @@ -549,7 +549,8 @@ bool HTTPClient::setURL(const String& url) DEBUG_HTTPCLIENT("[HTTP-Client][setURL] new URL not the same protocol, expected '%s', URL: '%s'\n", _protocol.c_str(), url.c_str()); return false; } - // disconnect but preserve _client + // disconnect but preserve _client (clear _canReuse so disconnect will close the connection) + _canReuse = false; disconnect(true); return beginInternal(url, nullptr); }