fix: some incoming headers were not displayed

This commit is contained in:
zefie
2024-05-30 16:39:00 -04:00
parent 5cf95e22d9
commit 8c7a6369fa
2 changed files with 5 additions and 6 deletions

View File

@@ -850,7 +850,7 @@ minisrv-no-mail-count: true`;
if ((shortURL.indexOf(":/ROMCache/") != -1 || shortURL.indexOf("://ROMCache/") != -1) && minisrv_config.config.enable_shared_romcache) {
shared_romcache = wtvshared.fixPathSlashes(minisrv_config.config.SharedROMCache + path.sep + shortURL.split(':/')[1]);
}
if (minisrv_config.config.debug_flags.show_headers) console.log(" * Incoming headers on socket ID", socket.id, (await wtvshared.decodePostData(wtvshared.filterRequestLog(wtvshared.filterSSID(request_headers)))));
if (minisrv_config.config.debug_flags.show_headers) console.log(" * Incoming headers on socket ID", socket.id, (await wtvshared.decodePostData(await wtvshared.filterRequestLog(await wtvshared.filterSSID(request_headers)))));
socket_sessions[socket.id].request_headers = request_headers;
processPath(socket, urlToPath, request_headers, service_name, shared_romcache, pc_services);
} else if (shortURL.indexOf('http://') >= 0 || shortURL.indexOf('https://') >= 0 || (use_external_proxy == true && shortURL.indexOf(service_name + "://") >= 0) && !pc_services) {
@@ -872,7 +872,7 @@ minisrv-no-mail-count: true`;
debug('request_headers', request_headers);
if (request_headers.request.indexOf("HTTP/1.0") > 0) {
// webtv in HTTP/1.0 mode, try to kick it back to WTVP
if (minisrv_config.config.debug_flags.show_headers) console.log(" * Incoming invalid headers on socket ID", socket.id, (await wtvshared.decodePostData(wtvshared.filterRequestLog(wtvshared.filterSSID(request_headers)))));
if (minisrv_config.config.debug_flags.show_headers) console.log(" * Incoming invalid headers on socket ID", socket.id, (await wtvshared.decodePostData(await wtvshared.filterRequestLog(await wtvshared.filterSSID(request_headers)))));
var errpage = wtvshared.doErrorPage(500, null, null, false, true);
headers = errpage[0];
data = ''
@@ -880,7 +880,7 @@ minisrv-no-mail-count: true`;
sendToClient(socket, headers, data);
} else {
// error reading headers (no request_url provided)
if (minisrv_config.config.debug_flags.show_headers) console.log(" * Incoming invalid headers on socket ID", socket.id, (await wtvshared.decodePostData(wtvshared.filterRequestLog(wtvshared.filterSSID(request_headers)))));
if (minisrv_config.config.debug_flags.show_headers) console.log(" * Incoming invalid headers on socket ID", socket.id, (await wtvshared.decodePostData(await wtvshared.filterRequestLog(await wtvshared.filterSSID(request_headers)))));
var errpage = wtvshared.doErrorPage(400, null, null, false, true);
headers = errpage[0];
data = ''
@@ -977,7 +977,7 @@ async function doHTTPProxy(socket, request_headers) {
var idx = request_headers.request_url.indexOf('/') - 1;
var request_type = request_headers.request_url.substring(0, idx);
if (minisrv_config.config.debug_flags.show_headers) console.log(request_type.toUpperCase() + " Proxy: Client Request Headers on socket ID", socket.id, (await wtvshared.decodePostData(wtvshared.filterRequestLog(wtvshared.filterSSID(request_headers)))));
if (minisrv_config.config.debug_flags.show_headers) console.log(request_type.toUpperCase() + " Proxy: Client Request Headers on socket ID", socket.id, (await wtvshared.decodePostData(await wtvshared.filterRequestLog(await wtvshared.filterSSID(request_headers)))));
switch (request_type) {
case "https":
var proxy_agent = https;