diff --git a/src/storage/object/get.js b/src/storage/object/get.js index 04923694..9deefca5 100644 --- a/src/storage/object/get.js +++ b/src/storage/object/get.js @@ -31,6 +31,16 @@ export default async function getObject(env, { bucket, org, key }, head = false) if (!head) { try { const resp = await client.send(new GetObjectCommand(input)); + + /* c8 ignore start */ + if (resp.ContentEncoding === 'gzip') { + // log to track which documents are gzip encoded and run scripts to fix them + // eslint-disable-next-line no-console + console.warn('Content is gzip encoded - request might fail'); + throw new Error('Corrupted content'); + } + /* c8 ignore end */ + return { body: resp.Body, status: resp.$metadata.httpStatusCode,