Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/storage/object/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down