mirror of
https://github.com/me-no-dev/ESPAsyncWebServer.git
synced 2026-01-26 16:52:20 +01:00
Add basic auth for server static (#143)
* Add basic auth for server static * Also effect to Websocket * Add http basic auth for event source & document to README.md
This commit is contained in:
@@ -229,6 +229,8 @@ bool AsyncEventSource::canHandle(AsyncWebServerRequest *request){
|
||||
}
|
||||
|
||||
void AsyncEventSource::handleRequest(AsyncWebServerRequest *request){
|
||||
if((_username != "" && _password != "") && !request->authenticate(_username.c_str(), _password.c_str()))
|
||||
return request->requestAuthentication();
|
||||
request->send(new AsyncEventSourceResponse(this));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user