Repository navigation
test(contract): expect Content-Encoding among the exposed headers - #25
Merged
Merged
Conversation
The public gateway lists Content-Encoding in Access-Control-Expose-Headers (decdn/decdn#2817), so a page on another origin can tell a body was decoded on the way and skip Content-Length as a bound. The fake mirrors the list and the public contract asserts it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
scripts/decdn-contract.sh --tag names its release in DECDN_CONTRACT_RELEASE, and shippedAfter(version) in the fixture gates a contract test on it. The Content-Encoding expose test runs only on gateways after v0.3.1, the fake and every --ref run. Co-Authored-By: Claude Opus 5.5 <[email protected]>
decdn's harness counts every collected test and fails a run that skips one, so a test gated by shippedAfter is declared only when the gateway carries it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 11, 2026
Co-Authored-By: Claude Fable 5.2 <[email protected]>
alpergundogdu
added a commit
to decdn/sdk-python
that referenced
this pull request
Nov 11, 2026
The public gateway adds `Content-Encoding` to `Access-Control-Expose-Headers` (decdn/decdn#2817, gateway change in decdn/decdn#2870), so a page on another origin can tell that a proxy in front encoded the body. ## Changes - `tests/fake_gateway.py` and `tests/unit/test_fake_gateway.py`: `EXPOSED` lists `Content-Encoding` after `Content-Length`, as the gateway does. - `tests/contract/test_public.py`: a blob read with an `Origin` finds `content-encoding` and `content-length` in `access-control-expose-headers`. - `tests/contract/fixture.py`: `shipped_after(version)` says whether the gateway under test carries behaviour decdn shipped after that release. `scripts/decdn-contract.sh --tag` sets `DECDN_CONTRACT_RELEASE`; the fake and `--ref` runs carry everything. - The new test is declared inside `if shipped_after("0.3.1"):`. It is left out, not skipped, because decdn's harness fails a run where any collected test is skipped. CONTRIBUTING.md describes the pattern. This is the same gate as decdn/sdk-typescript#25. ## Order This PR merges first. decdn/decdn#2870 pins `.github/sdk-python.sha` to this branch's head. ## Gateway floor `gateway-floor` stays as is: the SDK code does not change, and the weekly release-gateway runs do not collect the new test. ## Tests - `uv run ruff check .`, `uv run ruff format --check .`, `uv run mypy`, `shellcheck scripts/decdn-contract.sh`: pass. - `uv run pytest tests/unit tests/contract`: 354 passed. - With `DECDN_CONTRACT_RELEASE=0.3.1` the new test is not collected; with 0.3.2 or 0.4.0-rc.1 it runs and passes. - `tests/scripts/test_decdn_contract.py` fails locally on macOS, unrelated to this change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
alpergundogdu
added a commit
to decdn/decdn
that referenced
this pull request
Nov 13, 2026
decdn/sdk-typescript#25 and decdn/sdk-python#12 squash-merged, so the pins move from the PR branch heads to the commits on each SDK's main. The trees are identical. Co-authored-by: Claude Fable 5.2 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The public gateway adds
Content-EncodingtoAccess-Control-Expose-Headers(decdn/decdn#2817, gateway change in decdn/decdn#2870). A page on another origin then sees that a proxy in front encoded the body, so the client skipsContent-Lengthas a lower bound and ascontentLength(the logic from #21).Changes
test/fake-gateway.ts:EXPOSEDlistsContent-EncodingafterContent-Length, as the gateway does.test/contract/public.test.ts: a blob read from another origin findscontent-encodingandcontent-lengthinaccess-control-expose-headers.test/contract/fixture.ts:shippedAfter(version)says whether the gateway under test carries behaviour decdn shipped after that release.scripts/decdn-contract.sh --tagsetsDECDN_CONTRACT_RELEASE; the fake and--refruns (including decdn's own contract run) carry everything.if (shippedAfter("0.3.1")). It is left out, not skipped, because decdn's harness fails a run where any collected test is skipped. CONTRIBUTING.md describes the pattern.Order
This PR merges first. decdn/decdn#2870 pins
.github/sdk-typescript.shato this branch's head.Gateway floor
decdn.gatewayFloorstays at0.3.0. The SDK code does not change, and the release-gateway runs against v0.3.0 and v0.3.1 do not collect the new test.Tests
pnpm lint,pnpm build,shellcheck scripts/decdn-contract.sh: pass.vitest run test/contract test/unit: 155 passed.DECDN_CONTRACT_RELEASEset to 0.3.0 or 0.3.1: 16 tests, none skipped. Set to 0.3.2: 17.test/scripts/*fail locally on macOS (BSDtar --mtime, changelog tool), unrelated to this change.🤖 Generated with Claude Code