From b72d494a9b72302670a0ef318dc6dde94bbcd565 Mon Sep 17 00:00:00 2001 From: zefie Date: Tue, 24 Jun 2025 15:18:48 -0400 Subject: [PATCH] fix cgi 403 error tried to send multiple times --- zefie_wtvp_minisrv/app.js | 4 +++- zefie_wtvp_minisrv/includes/classes/WTVIRC.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/zefie_wtvp_minisrv/app.js b/zefie_wtvp_minisrv/app.js index 7e57e3ae..753b3f4e 100644 --- a/zefie_wtvp_minisrv/app.js +++ b/zefie_wtvp_minisrv/app.js @@ -474,7 +474,7 @@ async function handleCGI(executable, cgi_file, socket, request_headers, vault, s } async function handlePHP(socket, request_headers, php_file, vault, service_name, session_data = null, extra_path = "") { - handleCGI(minisrv_config.config.php_binpath, php_file, socket, request_headers, vault, service_name, session_data, extra_path); + await handleCGI(minisrv_config.config.php_binpath, php_file, socket, request_headers, vault, service_name, session_data, extra_path); } async function processPath(socket, service_vault_file_path, request_headers = new Array(), service_name, shared_romcache = null, pc_services = false) { @@ -651,6 +651,7 @@ async function processPath(socket, service_vault_file_path, request_headers = ne } } else { // php is not enabled, don't expose source code + service_vault_found = true; var errpage = wtvshared.doErrorPage(403, null, null, pc_services); sendToClient(socket, errpage[0], errpage[1]); return; @@ -678,6 +679,7 @@ async function processPath(socket, service_vault_file_path, request_headers = ne } } else { // php is not enabled, don't expose source code + service_vault_found = true; var errpage = wtvshared.doErrorPage(403, null, null, pc_services); sendToClient(socket, errpage[0], errpage[1]); return; diff --git a/zefie_wtvp_minisrv/includes/classes/WTVIRC.js b/zefie_wtvp_minisrv/includes/classes/WTVIRC.js index 5b4950b0..1334503c 100644 --- a/zefie_wtvp_minisrv/includes/classes/WTVIRC.js +++ b/zefie_wtvp_minisrv/includes/classes/WTVIRC.js @@ -873,7 +873,7 @@ class WTVIRC { this.debugLog('warn', `No socket found for target unique ID ${targetUniqueId}`); break; } - await this.safeWriteToSocket(targetSocket, `:${nickname} MODE ${targetSocket.nickname} ${parts.slice(2).join(' ')}\r\n`); + await this.safeWriteToSocket(targetSocket, `:${targetSocket.nickname} MODE ${targetSocket.nickname} ${parts.slice(2).join(' ')}\r\n`); if (this.clientIsWebTV(targetSocket) && this.enable_webtv_command_hacks) { await this.sendWebTVNoticeTo(targetSocket, `The network has set your user mode: ${parts.slice(3).join(' ')}`); }