Skip to content

fix: preserve Content-Length on blob and manifest GET/HEAD#136

Open
m-ferrero wants to merge 1 commit into
cloudflare:mainfrom
aggrega-ai:fix/response-headers
Open

fix: preserve Content-Length on blob and manifest GET/HEAD#136
m-ferrero wants to merge 1 commit into
cloudflare:mainfrom
aggrega-ai:fix/response-headers

Conversation

@m-ferrero

Copy link
Copy Markdown

Problem

When a client sends Accept-Encoding: gzip, the runtime gzip-encodes blob and manifest GET responses and switches them to chunked transfer-encoding, dropping the Content-Length the distribution spec requires. It only manifests at the real wire layer (Go net/http-style clients, the OCI conformance suite); a plain in-process fetch does not trigger it.

Solution

Set Content-Encoding: identity on the blob and manifest GET responses so the body is served verbatim and its Content-Length is preserved. The matching HEAD responses set it too, so a HEAD's headers mirror its GET.

Tests

Adds assertions that Content-Length (and Content-Encoding: identity) is present and correct on blob and manifest GET and HEAD.

Part of #134.

Set Content-Encoding: identity so the runtime does not switch these responses to chunked
transfer-encoding (which drops Content-Length); the distribution spec requires Content-Length
on blob and manifest GET/HEAD. Adds regression tests for the blob/manifest GET and HEAD headers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant