mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-07-29 10:02:48 +00:00
merge all URI handlers into a single dispatch function
This commit is contained in:
@@ -32,9 +32,6 @@ WebLogService::WebLogService(AsyncWebServer * server, SecurityManager * security
|
||||
[this](AsyncWebServerRequest * request, JsonVariant json) { getSetValues(request, json); },
|
||||
HTTP_ANY);
|
||||
|
||||
// Add authentication filter to EventSource
|
||||
// EventSource (SSE) cannot use custom headers, so authentication is done via URL parameter
|
||||
// events_.setFilter(securityManager->filterRequest(AuthenticationPredicates::IS_AUTHENTICATED));
|
||||
server->addHandler(&events_);
|
||||
}
|
||||
|
||||
@@ -211,6 +208,7 @@ void WebLogService::getSetValues(AsyncWebServerRequest * request, JsonVariant js
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// POST - write the settings
|
||||
level_ = json["level"];
|
||||
maximum_log_messages_ = json["max_messages"];
|
||||
@@ -234,6 +232,7 @@ void WebLogService::getSetValues(AsyncWebServerRequest * request, JsonVariant js
|
||||
settings.weblog_buffer = maximum_log_messages_;
|
||||
return StateUpdateResult::CHANGED;
|
||||
});
|
||||
|
||||
request->send(200); // OK
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user