Repository navigation
fix(routing): apply authored headers without overwriting auth cache policy - #669
Brooooooklyn merged 10 commits into
Conversation
… headers - Refresh the static-asset mark after a rule sets Cache-Control, so auth makes the authored file policy private for credentialed requests instead of replacing it with no-store. - Append Set-Cookie rules so the response's own cookies, including the Better Auth session, are kept. - Only count Better Auth cookies when deciding that a response needs the auth cache policy; app cookies keep the route's own policy. - Skip the outer header pass for fallback answers, so only the destination's rules apply, as in @void/edge and platform dispatch. - Docs: say where auth keeps private caching and what a platform does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the fix and the clear write-up. I reviewed it in depth and pushed a follow-up commit, and merged The core change (rules applied through How:
Left as is (noted for follow-ups, not part of #579):
|
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 933062d109
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Thanks for the review @Brooooooklyn! I addressed the two later Codex findings in 8910d96. A cookie-free rewrite to /api/auth/get-session now keeps Cache-Control: no-store, and early auth errors keep their configured CORS headers. You marked the early auth error case as outside #579, so I can move that part to a separate PR if you prefer it that way. |
…rors - After c.rewrite(), the destination's header pass may already have added a Set-Cookie rule value; the outer pass no longer adds it again. - Mark the inner header pass only once it has run after next(), so a notFound handler that throws past it still gets header rules from the outer error pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2d2ff5117e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ast Set-Cookie rule - When auth makes a response private, also drop CDN-Cache-Control, Cloudflare-CDN-Cache-Control and Surrogate-Control, including values a header rule set, so a CDN cannot cache a signed-in page. - The last matching rule wins for each header name, Set-Cookie included. A rewrite's outer pass skips the cookie only when the destination pass already added it last. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…697) Fixes a flaky unit run seen on #669: every test passed, but Vitest failed the job on an uncaught `Error: write EPIPE` from `dockerBuild` in `@cloudflare/vite-plugin` (test: "binds Container Durable Objects in the dev server…", added in #696). ``` dockerBuild: spawn(docker build … -f -) → child.stdin.write(Dockerfile) old stub #!/bin/sh exit 0 → on a busy runner the stub exits before the write → write EPIPE, no error listener → uncaught → job fails new stub if [ "$1" = build ]; then cat >/dev/null; fi exit 0 → the stub waits until stdin closes, so the write always lands ``` Reproduced locally by blocking the parent between `spawn` and `write` (same order as the CI trace): | stub | result | | --- | --- | | old | `Error: write EPIPE` | | new | ok | Only `build` reads stdin, so other Docker calls cannot block on it. Test-only change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Fixes #579
Apply routing header rules through Hono's header API so configured values replace existing response headers. Keep authentication in control of private and no-store caching, including sign-in responses reached through rewrites or fallbacks.
Preserve last-match precedence and document that header rules also apply to matching error responses.
Validation: