Skip to content

test(fake): redirect a site directory and serve one under /_decdn/ as its index.html - #30

Merged
yigitdot merged 3 commits into
mainfrom
test/fake-directory-redirect
Nov 23, 2026
Merged

yigitdot merged 3 commits into
mainfrom
test/fake-directory-redirect

Conversation

@yigitdot

@yigitdot yigitdot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #29.

The fake gateway mirrors decdn/decdn#2818 (branch fix/2818-decdn-directory-index, at fc4015d2):

  • Under a site's /_decdn/, a directory in a bundle (<h>/docs/, <h>/docs/?ns=7) serves its index.html.
  • A directory redirect keeps the request's query: /_decdn/<h>/docs?ns=7 → docs/?ns=7, and a site's own /docs?tab=2 → docs/?tab=2, on GET and HEAD. fc4015d2 added the own-path case after the issue was written.
  • A HEAD or a navigation (no Sec-Fetch-Mode, or navigate) of bundle content under /_decdn/ redirects to the bundle's site, at no pull. A directory redirects to the directory there (<site>/docs/), not to its index.html. A blob is still served.

Tests:

  • The contract fixture bundle gains docs/index.html.
  • A new public contract test, gated shippedAfter("0.3.1"), covers these cases. It fetches /_decdn/<h>/docs/ for a 200 without ?ns= only, because ?ns= routes the pull by a namespace the network need not serve. That matches sdk-python's contract test.
  • New unit tests cover:
    • HEAD of a directory, an entry and the bundle root under /_decdn/, including with ?ns=7.
    • Navigation redirects.
    • The own-path HEAD query.
    • A directory with no index.html answering 404.
    • The allowance staying unchanged where nothing is pulled.

On the decdn side, sdk_contract.rs needs docs/index.html in its bundle, and the SDK pins need moving to this branch's merge commit. That work belongs to the decdn#2941 session, not this PR. Until it lands, decdn's SDK contract run at a pin that includes this test fails, on purpose, with "the fixture bundle has no docs/index.html".

🤖 Generated with Claude Code

yigitdot and others added 3 commits November 23, 2026 05:15
… its index.html

The fake mirrors decdn/decdn#2818: under a site's /_decdn/, a directory in
a bundle serves its index.html, HEAD of bundle content redirects to its
site (a directory to the directory) at no pull, and a directory redirect
keeps the request's query, on a site's own paths too. The contract
fixture bundle gains docs/index.html, and a contract test, gated after
v0.3.1, covers these cases.

Closes #29

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@yigitdot
yigitdot merged commit faa4995 into main Nov 23, 2026
18 checks passed
@yigitdot
yigitdot deleted the test/fake-directory-redirect branch November 23, 2026 04:23
yigitdot added a commit that referenced this pull request Nov 23, 2026
Port the /_decdn/ redirect tests from #30 to capabilities-only public
gateways: no allowance, and no pull means nothing paid.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

fake gateway: a directory under a site's /_decdn/ serves its index.html, and its redirect keeps the query

1 participant