fix standalone

This commit is contained in:
MichaelDvP
2026-07-12 17:25:51 +02:00
parent 4e47be7fa6
commit 342878f628
2 changed files with 4 additions and 0 deletions

View File

@@ -728,8 +728,10 @@ std::string compute(const std::string & expr) {
} }
if (url.substr(0, 4) == "http") { // match http and https if (url.substr(0, 4) == "http") { // match http and https
HTTPClient * http = new HTTPClient; HTTPClient * http = new HTTPClient;
#ifndef EMSESP_STANDALONE
http->setConnectTimeout(10000); http->setConnectTimeout(10000);
http->setTimeout(10000); http->setTimeout(10000);
#endif
if (http->begin(url.c_str())) { if (http->begin(url.c_str())) {
int httpResult = 0; int httpResult = 0;
for (JsonPair p : doc[header_s].as<JsonObject>()) { for (JsonPair p : doc[header_s].as<JsonObject>()) {

View File

@@ -355,8 +355,10 @@ bool WebSchedulerService::command(const char * name, const std::string & command
JsonDocument doc; JsonDocument doc;
if (deserializeJson(doc, cmd) == DeserializationError::Ok) { if (deserializeJson(doc, cmd) == DeserializationError::Ok) {
HTTPClient * http = new HTTPClient; HTTPClient * http = new HTTPClient;
#ifndef EMSESP_STANDALONE
http->setConnectTimeout(10000); http->setConnectTimeout(10000);
http->setTimeout(10000); http->setTimeout(10000);
#endif
std::string url = doc["url"] | ""; std::string url = doc["url"] | "";
// for a GET with parameters replace commands with values // for a GET with parameters replace commands with values
// don't search the complete url, it may contain a devicename in path // don't search the complete url, it may contain a devicename in path