Skip to content

Commit 6a17b1f

Browse files
committed
fix: prevent CDN transformations that affect checksum verification
1 parent 45a7c1b commit 6a17b1f

File tree

1 file changed

+3
-0
lines changed
  • supabase/functions/_backend/files

1 file changed

+3
-0
lines changed

supabase/functions/_backend/files/files.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ async function getHandler(c: Context): Promise<Response> {
147147
function objectHeaders(object: R2Object): Headers {
148148
const headers = new Headers()
149149
object.writeHttpMetadata(headers)
150+
// Prevent CDN transformations (auto-minify, email obfuscation, etc.) that modify
151+
// bytes in transit, breaking checksum verification on devices.
152+
headers.set('cache-control', 'no-transform')
150153
headers.set('etag', object.httpEtag)
151154

152155
// the sha256 checksum was provided to R2 in the upload

0 commit comments

Comments
 (0)