mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
add back security
This commit is contained in:
@@ -32,6 +32,9 @@ WebLogService::WebLogService(AsyncWebServer * server, SecurityManager * security
|
|||||||
[this](AsyncWebServerRequest * request, JsonVariant json) { getSetValues(request, json); },
|
[this](AsyncWebServerRequest * request, JsonVariant json) { getSetValues(request, json); },
|
||||||
HTTP_ANY);
|
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_);
|
server->addHandler(&events_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user