From 64cfd9ead22899a1c0454998abe3362bbd393861 Mon Sep 17 00:00:00 2001 From: nemirwen Date: Fri, 26 Sep 2025 17:53:21 +0200 Subject: [PATCH] Add support for plaintext responses with no encoding --- harextract.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/harextract.html b/harextract.html index 6dfd27a..04aa5da 100644 --- a/harextract.html +++ b/harextract.html @@ -177,7 +177,7 @@ harent.pathcomps = fullpath; // .path string will be set below if (!ent.response.content.text) harent.error = 'No content.'; - else if (ent.response.content.encoding != 'base64') + else if (!!ent.response.content.encoding && ent.response.content.encoding != 'base64') harent.error = "Can't decode."; if (harent.error) { console.log(`harextract: skipped ${harent.name} (${id}): ${harent.error}`); @@ -279,9 +279,9 @@ if (filepath.startsWith('/')) filepath = filepath.substring(1); let encoding = data[ent.id].response.content.encoding; - if (encoding != 'base64') + if (!!encoding && encoding != 'base64') throw new Error(`Unsupported encoding for ${ent.name} (${ent.id}): ${encoding}`); - zip.file(filepath, data[ent.id].response.content.text, { base64: true }); + zip.file(filepath, data[ent.id].response.content.text, { base64: !!encoding }); } catch (e) { console.log(e); }