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:
omersiar 2017-10-30 11:43:31 +03:00 committed by Me No Dev
parent 313f3372c6
commit d366e7c539
2 changed files with 5 additions and 2 deletions

View File

@ -173,7 +173,7 @@ To use this library you might need to have the latest git versions of [ESP32](ht
- [VZero](https://github.com/andig/vzero) - the Wireless zero-config controller for volkszaehler.org
- [ESPurna](https://bitbucket.org/xoseperez/espurna) - ESPurna ("spark" in Catalan) is a custom C firmware for ESP8266 based smart switches. It was originally developed with the ITead Sonoff in mind.
- [fauxmoESP](https://bitbucket.org/xoseperez/fauxmoesp) - Belkin WeMo emulator library for ESP8266.
- [ESP-RFID] (https://github.com/omersiar/esp-rfid) - MFRC522 RFID Access Control Management project for ESP8266.
- [ESP-RFID](https://github.com/omersiar/esp-rfid) - MFRC522 RFID Access Control Management project for ESP8266.
## Request Variables

View File

@ -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);