Skip to content

Commit 9e9515b

Browse files
liebmandevyte
authored andcommitted
clear _canReuse in setUrl if its not a local redirect (esp8266#7039)
1 parent bb696dd commit 9e9515b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,8 @@ bool HTTPClient::setURL(const String& url)
549549
DEBUG_HTTPCLIENT("[HTTP-Client][setURL] new URL not the same protocol, expected '%s', URL: '%s'\n", _protocol.c_str(), url.c_str());
550550
return false;
551551
}
552-
// disconnect but preserve _client
552+
// disconnect but preserve _client (clear _canReuse so disconnect will close the connection)
553+
_canReuse = false;
553554
disconnect(true);
554555
return beginInternal(url, nullptr);
555556
}

0 commit comments

Comments
 (0)