From 002c221f05f521cb46a9b4fd52e7fcaf94e6a89d Mon Sep 17 00:00:00 2001 From: Eric MacDonald Date: Tue, 10 Aug 2021 22:32:10 -0400 Subject: [PATCH] Remove WordArray from allowed input types then fix garbled text encoding issue --- zefie_wtvp_minisrv/WTVLzpf.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/zefie_wtvp_minisrv/WTVLzpf.js b/zefie_wtvp_minisrv/WTVLzpf.js index 5bfea2ea..5983dc47 100644 --- a/zefie_wtvp_minisrv/WTVLzpf.js +++ b/zefie_wtvp_minisrv/WTVLzpf.js @@ -447,27 +447,19 @@ class WTVLzpf { /** * Converts the data to a Javascript Buffer object * - * @param data {String|Buffer|CryptoJS.lib.WordArray} Data to convert + * @param data {String|Buffer} Data to convert * * @returns {Buffer} Javascript Buffer object */ ConvertToBuffer(data) { - if (data.words) { - var WTVSec = require("./WTVSec.js"); - wtvsec = new WTVSec(1); - data = wtvsec.wordArrayToBuffer(data); - WTVSec, wtvsec = null; - } else if (!data.byteLength) { - // otherwise if its not already a Buffer, convert it to one - data = new Buffer.from(data); - } + data = new Buffer.from(data.toString('binary')); return data; } /** * Compress data using WebTV's Lzpf compression algorithm and adds the footer to the end. * - * @param uncompressed_data {String|Buffer|CryptoJS.lib.WordArray} data to compress + * @param uncompressed_data {String|Buffer} data to compress * * @returns {Buffer} Lzpf compression data */