Skip to content
This repository was archived by the owner on Mar 5, 2026. It is now read-only.

Commit d366e7c

Browse files
omersiarme-no-dev
authored andcommitted
This re-enables previously removed WebSocket authentication which is … (me-no-dev#272)
* This re-enables previously removed WebSocket authentication which is orginaly implemented PR me-no-dev#143 * Update README.md
1 parent 313f337 commit d366e7c

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ To use this library you might need to have the latest git versions of [ESP32](ht
173173
- [VZero](https://github.com/andig/vzero) - the Wireless zero-config controller for volkszaehler.org
174174
- [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.
175175
- [fauxmoESP](https://bitbucket.org/xoseperez/fauxmoesp) - Belkin WeMo emulator library for ESP8266.
176-
- [ESP-RFID] (https://github.com/omersiar/esp-rfid) - MFRC522 RFID Access Control Management project for ESP8266.
176+
- [ESP-RFID](https://github.com/omersiar/esp-rfid) - MFRC522 RFID Access Control Management project for ESP8266.
177177

178178
## Request Variables
179179

@@ -1365,4 +1365,4 @@ webServer.onNotFound([](AsyncWebServerRequest *request) {
13651365
request->send(404);
13661366
}
13671367
});
1368-
```
1368+
```

src/AsyncWebSocket.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,9 @@ void AsyncWebSocket::handleRequest(AsyncWebServerRequest *request){
10981098
request->send(400);
10991099
return;
11001100
}
1101+
if((_username != "" && _password != "") && !request->authenticate(_username.c_str(), _password.c_str())){
1102+
return request->requestAuthentication();
1103+
}
11011104
AsyncWebHeader* version = request->getHeader(WS_STR_VERSION);
11021105
if(version->value().toInt() != 13){
11031106
AsyncWebServerResponse *response = request->beginResponse(400);

0 commit comments

Comments
 (0)