From 9e9515b49fe635767afb1ae5c8a2f61694ffd794 Mon Sep 17 00:00:00 2001 From: liebman Date: Mon, 27 Jan 2020 19:35:16 -0800 Subject: [PATCH] clear _canReuse in setUrl if its not a local redirect (#7039) --- 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 422dd3a0c..c3f6107fc 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); }