post_data now logs as hex instead of raw WordArray

This commit is contained in:
zefie
2022-02-10 01:51:23 -05:00
parent 8068f842df
commit d14c4293aa
2 changed files with 10 additions and 2 deletions

View File

@@ -155,6 +155,14 @@ class WTVShared {
} }
} }
decodePostData(obj) {
if (obj.post_data) {
var post_data = obj.post_data;
obj.post_data = obj.post_data.toString();
}
return obj;
}
/** /**
* Returns an absolute path * Returns an absolute path
* @param {string} path * @param {string} path

View File

@@ -424,7 +424,7 @@ Location: " + minisrv_config.config.unauthorized_url`;
// assume webtv since there is a :/ in the GET // assume webtv since there is a :/ in the GET
var service_name = shortURL.split(':/')[0]; var service_name = shortURL.split(':/')[0];
var urlToPath = wtvshared.fixPathSlashes(service_name + path.sep + shortURL.split(':/')[1]); var urlToPath = wtvshared.fixPathSlashes(service_name + path.sep + shortURL.split(':/')[1]);
if (minisrv_config.config.debug_flags.show_headers) console.log(" * Incoming headers on socket ID", socket.id, (await 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.filterSSID(request_headers))));
socket_sessions[socket.id].request_headers = request_headers; socket_sessions[socket.id].request_headers = request_headers;
processPath(socket, urlToPath, request_headers, service_name); processPath(socket, urlToPath, request_headers, service_name);
} else if (shortURL.indexOf('http://') >= 0 || shortURL.indexOf('https://') >= 0) { } else if (shortURL.indexOf('http://') >= 0 || shortURL.indexOf('https://') >= 0) {
@@ -442,7 +442,7 @@ Location: " + minisrv_config.config.unauthorized_url`;
async function doHTTPProxy(socket, request_headers) { async function doHTTPProxy(socket, request_headers) {
var request_type = (request_headers.request_url.substring(0, 5) == "https") ? "https" : "http"; var request_type = (request_headers.request_url.substring(0, 5) == "https") ? "https" : "http";
if (minisrv_config.config.debug_flags.show_headers) console.log(request_type.toUpperCase() + " Proxy: Client Request Headers on socket ID", socket.id, (await 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.filterSSID(request_headers))));
switch (request_type) { switch (request_type) {
case "https": case "https":
var proxy_agent = https; var proxy_agent = https;