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:
1 parent
313f3372c6
commit
d366e7c539
2 files changed
+5
-2
No files matched your search
@@ -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