forgot 'request_is_async' in the last commit

... and trying not to squash anymore
This commit is contained in:
zefie
2022-09-26 17:29:12 -04:00
parent 6a21c4a851
commit e22bb22497

View File

@@ -109,15 +109,15 @@ async function processPath(socket, service_vault_file_path, request_headers = ne
var service_path = unescape(service_vault_file_path); var service_path = unescape(service_vault_file_path);
var usingSharedROMCache = false; var usingSharedROMCache = false;
// Here we define the ServiceVault Script Context Object // Here we define the ServiceVault Script Context Object
// The ServiceVault scripts will only be allowed to access the following variables. // The ServiceVault scripts will only be allowed to access the following fcnutions/variables.
// Furthermore, only modifications to variables in `updateFromVM` will be saved. // Furthermore, only modifications to variables in `updateFromVM` will be saved.
// Example: an attempt to change "minisrv_config" from a ServiceVault script would be discarded // Example: an attempt to change "minisrv_config" from a ServiceVault script would be discarded
// node core functions/vars // node core functions/vars
var contextObj = { var contextObj = {
console: console, console: console, // needed for per-script debugging
require: require, require: require, // this is dangerous but needed for some scripts at this time
__dirname: __dirname __dirname: __dirname // needed by services such as wtv-flashrom and wtv-disk
} }
// Our modules // Our modules
@@ -163,10 +163,12 @@ async function processPath(socket, service_vault_file_path, request_headers = ne
} }
var updateFromVM = [ var updateFromVM = [
["headers", "headers"], // format: [ ourvarname, scriptsvarname ]
["data", "data"], ["headers", "headers"], // we need to be able to read the script's response headers
["ssid_sessions", "ssid_sessions"], ["data", "data"], // we need to be able to read the script's response data
["socket_sessions", "socket_sessions"] ["request_is_async", "request_is_async"], // we need to know if the script wants to be async or not
["ssid_sessions", "ssid_sessions"], // certain scripts need to update the user session, such as wtv-setup, wtv-mail, etc
["socket_sessions", "socket_sessions"] // certain scripts need to update the socket session, such as wtv-1800, etc
]; ];
try { try {