diff --git a/zefie_wtvp_minisrv/WTVShared.js b/zefie_wtvp_minisrv/WTVShared.js index beefed44..32e8198a 100644 --- a/zefie_wtvp_minisrv/WTVShared.js +++ b/zefie_wtvp_minisrv/WTVShared.js @@ -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 * @param {string} path diff --git a/zefie_wtvp_minisrv/app.js b/zefie_wtvp_minisrv/app.js index cdfb2636..0ed09c0b 100644 --- a/zefie_wtvp_minisrv/app.js +++ b/zefie_wtvp_minisrv/app.js @@ -424,7 +424,7 @@ Location: " + minisrv_config.config.unauthorized_url`; // assume webtv since there is a :/ in the GET var service_name = shortURL.split(':/')[0]; 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; processPath(socket, urlToPath, request_headers, service_name); } 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) { 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) { case "https": var proxy_agent = https;