forked from me-no-dev/ESPAsyncWebServer
This re-enables previously removed WebSocket authentication which is … (#272)
* This re-enables previously removed WebSocket authentication which is orginaly implemented PR #143 * Update README.md
This commit is contained in:
@@ -1098,6 +1098,9 @@ void AsyncWebSocket::handleRequest(AsyncWebServerRequest *request){
|
||||
request->send(400);
|
||||
return;
|
||||
}
|
||||
if((_username != "" && _password != "") && !request->authenticate(_username.c_str(), _password.c_str())){
|
||||
return request->requestAuthentication();
|
||||
}
|
||||
AsyncWebHeader* version = request->getHeader(WS_STR_VERSION);
|
||||
if(version->value().toInt() != 13){
|
||||
AsyncWebServerResponse *response = request->beginResponse(400);
|
||||
|
Reference in New Issue
Block a user