1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-15 00:02:49 +03:00

clear _canReuse in setUrl if its not a local redirect (#7039)

This commit is contained in:
liebman
2020-01-27 19:35:16 -08:00
committed by Develo
parent bb696dd204
commit 9e9515b49f

View File

@ -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()); DEBUG_HTTPCLIENT("[HTTP-Client][setURL] new URL not the same protocol, expected '%s', URL: '%s'\n", _protocol.c_str(), url.c_str());
return false; return false;
} }
// disconnect but preserve _client // disconnect but preserve _client (clear _canReuse so disconnect will close the connection)
_canReuse = false;
disconnect(true); disconnect(true);
return beginInternal(url, nullptr); return beginInternal(url, nullptr);
} }