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);
}