test(router-parity): HEAD on a remote GET answers 200 for CARD-20 (owner approval required)
CI / dco (pull_request) Successful in 4s
CI / runtimes (bun) (pull_request) Successful in 15s
CI / build (pull_request) Successful in 27s
CI / runtimes (deno) (pull_request) Successful in 20s
CI / runtimes (edge) (pull_request) Successful in 14s

owner-mesh-allow.json froze HEAD /api/x at 404 on both adapters: the
teacup forwarded HEAD to the teapot, which has no HEAD plan for the
route. CARD-20 (#125, D16) fixes that, so HEAD now answers 200 with the
GET's headers and an empty body, like a local route.

Only those two entries change (fetch and node), status 404 -> 200.
Headers and the empty body are identical. The fixture comment in
owner.test.ts that described the old behaviour is updated to match.

Owner approval required (CARD-08 rule): this edits a frozen file under
test/router-parity/.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
chrnx committed 2026-10-23 00:02:51 -05:00
1 parent 6341f26145
commit 3b124fb05b
2 files changed
+5 -5

No files matched your search

@@ -206,7 +206,7 @@
"adapter": "fetch", "adapter": "fetch",
"method": "HEAD", "method": "HEAD",
"path": "/api/x", "path": "/api/x",
"status": 404, "status": 200,
"headers": { "headers": {
"content-type": "application/json", "content-type": "application/json",
"referrer-policy": "no-referrer", "referrer-policy": "no-referrer",
@@ -472,7 +472,7 @@
"adapter": "node", "adapter": "node",
"method": "HEAD", "method": "HEAD",
"path": "/api/x", "path": "/api/x",
"status": 404, "status": 200,
"headers": { "headers": {
"content-type": "application/json", "content-type": "application/json",
"referrer-policy": "no-referrer", "referrer-policy": "no-referrer",
+3 -3
View File
@@ -141,9 +141,9 @@ class RemoteMixCtl {
return { from: 'teapot', route: 'POST /api/v/:id' }; return { from: 'teapot', route: 'POST /api/v/:id' };
} }
// Remote only: remote routes are `buffer`, so the teacup's router resolves HEAD to it implicitly. // Remote only: remote routes are `buffer`, so the teacup's router resolves HEAD to it implicitly.
// Captured as observed at ed47836: the teacup forwards the request as HEAD, the teapot looks its // Captured at ed47836 as HEAD → 404 (the teacup forwarded HEAD, and the teapot has no HEAD plan).
// plan up by (pattern, method) and has none for HEAD, so HEAD answers 404 while OPTIONS still // CARD-20 (#125, D16) changed that deliberately, with owner approval: the teacup forwards the
// advertises HEAD. That is the mesh proxy's behaviour, not the matcher's; CARD-07 must keep it. // HEAD as a GET and drops the body, so HEAD now answers 200 like a local route.
@Get('/x', { export: true }) x() { @Get('/x', { export: true }) x() {
return { from: 'teapot', route: 'GET /api/x' }; return { from: 'teapot', route: 'GET /api/x' };
} }