remove useless http check

This commit is contained in:
MichaelDvP
2024-08-02 12:04:17 +02:00
parent cd992ff457
commit 21c23e1fd8
2 changed files with 2 additions and 2 deletions

View File

@@ -346,7 +346,7 @@ bool WebSchedulerService::command(const char * name, const std::string & command
commands(s, false); commands(s, false);
url.replace(q + 1, l, s); url.replace(q + 1, l, s);
} }
if (!url.find("http") && http.begin(url.c_str())) { if (http.begin(url.c_str())) {
// add any given headers // add any given headers
for (JsonPair p : doc["header"].as<JsonObject>()) { for (JsonPair p : doc["header"].as<JsonObject>()) {
http.addHeader(p.key().c_str(), p.value().as<String>().c_str()); http.addHeader(p.key().c_str(), p.value().as<String>().c_str());

View File

@@ -614,7 +614,7 @@ std::string compute(const std::string & expr) {
if (DeserializationError::Ok == deserializeJson(doc, cmd)) { if (DeserializationError::Ok == deserializeJson(doc, cmd)) {
HTTPClient http; HTTPClient http;
std::string url = doc["url"] | ""; std::string url = doc["url"] | "";
if (!url.find("http") && http.begin(url.c_str())) { if (http.begin(url.c_str())) {
int httpResult = 0; int httpResult = 0;
for (JsonPair p : doc["header"].as<JsonObject>()) { for (JsonPair p : doc["header"].as<JsonObject>()) {
http.addHeader(p.key().c_str(), p.value().as<std::string>().c_str()); http.addHeader(p.key().c_str(), p.value().as<std::string>().c_str());