http_request fix urls caching (#1174)

* Fix cache

* CI Fix

Co-authored-by: Nikolay Vasilchuk <nikolay.vasilchuk@corp.mail.ru>
This commit is contained in:
Nikolay Vasilchuk 2020-07-21 23:26:21 +03:00 committed by GitHub
parent 6405799cc2
commit 10e411f8c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,15 +15,15 @@ void HttpRequestComponent::dump_config() {
void HttpRequestComponent::send() { void HttpRequestComponent::send() {
bool begin_status = false; bool begin_status = false;
this->client_.setReuse(true); this->client_.setReuse(true);
static const String URL = this->url_.c_str(); const String url = this->url_.c_str();
#ifdef ARDUINO_ARCH_ESP32 #ifdef ARDUINO_ARCH_ESP32
begin_status = this->client_.begin(URL); begin_status = this->client_.begin(url);
#endif #endif
#ifdef ARDUINO_ARCH_ESP8266 #ifdef ARDUINO_ARCH_ESP8266
#ifndef CLANG_TIDY #ifndef CLANG_TIDY
this->client_.setFollowRedirects(true); this->client_.setFollowRedirects(true);
this->client_.setRedirectLimit(3); this->client_.setRedirectLimit(3);
begin_status = this->client_.begin(*this->get_wifi_client_(), URL); begin_status = this->client_.begin(*this->get_wifi_client_(), url);
#endif #endif
#endif #endif