fix SSID check, also make it optional
This commit is contained in:
@@ -1124,7 +1124,7 @@ async function sendToClient(socket, headers_obj, data = null) {
|
||||
headers_obj = headerStringToObj(headers_obj, true);
|
||||
}
|
||||
if (!socket_sessions[socket.id]) {
|
||||
socket.destroy();
|
||||
if (socket.destroy) socket.destroy();
|
||||
return;
|
||||
}
|
||||
if (!socket.res) {
|
||||
@@ -1471,11 +1471,16 @@ async function processRequest(socket, data_hex, skipSecure = false, encryptedReq
|
||||
if (!headers) return;
|
||||
|
||||
if (headers["wtv-client-serial-number"] != null && socket.ssid == null) {
|
||||
if (minisrv_config.config.require_valid_ssid) {
|
||||
if (!wtvshared.checkSSID(headers["wtv-client-serial-number"])) {
|
||||
// close socket for invalid ssid
|
||||
cleanupSocket(socket)
|
||||
// reject invalid SSIDs
|
||||
var errpage = wtvshared.doErrorPage(400, "minisrv ran into a technical problem. Reason: Your SSID is not valid.");
|
||||
headers = errpage[0];
|
||||
data = errpage[1];
|
||||
sendToClient(socket, headers, data);
|
||||
return;
|
||||
}
|
||||
}
|
||||
socket.ssid = wtvshared.makeSafeSSID(headers["wtv-client-serial-number"]);
|
||||
if (socket.ssid != null) {
|
||||
if (!ssid_sessions[socket.ssid]) {
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
"allow_guests": true, // Allow users to experience the server without registering
|
||||
"domain_name": "wtv.zefie.com", // For usenet and future stuff, no need to change just yet,
|
||||
"max_post_length": 20, // in megabytes
|
||||
"require_valid_ssid": true, // require a valid SSID (with valid CRC)
|
||||
"user_accounts": { // user account settings
|
||||
"max_users_per_account": 6, // Max total users (including primary) per account
|
||||
"min_username_length": 5, // minimum username length
|
||||
|
||||
Reference in New Issue
Block a user