fix server crashing when file not found
This commit is contained in:
@@ -98,7 +98,7 @@ function doErrorPage(code, data = null, pc_mode = false) {
|
|||||||
headers += "Content-Type: text/html\n";
|
headers += "Content-Type: text/html\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
console.error("doErrorPage Called:", code, data);
|
console.error(" * doErrorPage Called:", code, data);
|
||||||
return new Array(headers, data);
|
return new Array(headers, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -577,9 +577,11 @@ async function sendToClient(socket, headers_obj, data) {
|
|||||||
// Add last modified if not a dynamic script
|
// Add last modified if not a dynamic script
|
||||||
if (socket_sessions[socket.id]) {
|
if (socket_sessions[socket.id]) {
|
||||||
if (socket_sessions[socket.id].request_headers) {
|
if (socket_sessions[socket.id].request_headers) {
|
||||||
if (wtvshared.getFileExt(socket_sessions[socket.id].request_headers.service_file_path).toLowerCase() !== "js") {
|
if (socket_sessions[socket.id].request_headers.service_file_path) {
|
||||||
var last_modified = wtvshared.getFileLastModifiedUTCString(socket_sessions[socket.id].request_headers.service_file_path);
|
if (wtvshared.getFileExt(socket_sessions[socket.id].request_headers.service_file_path).toLowerCase() !== "js") {
|
||||||
if (last_modified) headers_obj["Last-Modified"] = last_modified;
|
var last_modified = wtvshared.getFileLastModifiedUTCString(socket_sessions[socket.id].request_headers.service_file_path);
|
||||||
|
if (last_modified) headers_obj["Last-Modified"] = last_modified;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user