send 401 header too if auth string is empty #116

This commit is contained in:
Links
2017-03-18 10:32:37 +01:00
parent 1afe317c7d
commit 81e567b248

View File

@ -766,17 +766,13 @@ void WebSocketsServer::handleHeader(WSclient_t * client, String * headerLine) {
}
if(_base64Authorization.length() > 0) {
if(client->base64Authorization.length() > 0) {
String auth = WEBSOCKETS_STRING("Basic ");
auth += _base64Authorization;
if(auth != client->base64Authorization) {
DEBUG_WEBSOCKETS("[WS-Server][%d][handleHeader] HTTP Authorization failed!\n", client->num);
handleAuthorizationFailed(client);
return;
}
} else {
ok = false;
}
String auth = WEBSOCKETS_STRING("Basic ");
auth += _base64Authorization;
if(auth != client->base64Authorization) {
DEBUG_WEBSOCKETS("[WS-Server][%d][handleHeader] HTTP Authorization failed!\n", client->num);
handleAuthorizationFailed(client);
return;
}
}
if(ok) {