fix(hono): allow If-Match in default CORS headers so cross-origin OCC saves work (objectui#2572)#3067
Merged
Merged
Conversation
… saves work (objectui#2572) The REST record PATCH accepts the OCC token as an If-Match header — objectui's record-level inline edit sends it on every save — but the default CORS allow-list (plugin-hono-server + the hono adapter) omitted it, so on split-origin deployments the preflight failed and every inline-edit save died in the browser with 'Failed to fetch'. Found live while dogfooding objectui#2572 (console dev :5191 against a showcase backend on :4022); same split-origin class as the #2548 Bearer fixes. Explicit user-supplied allowHeaders still win unchanged; new unit test pins If-Match in the default list. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQjNZDdqmz2QHGQndpjZrR
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 2 package(s): 5 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
os-zhuang
marked this pull request as ready for review
July 16, 2026 14:42
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.
What
Adds
If-Matchto the default CORSallowHeadersin both places the default list lives:packages/plugins/plugin-hono-server/src/hono-plugin.ts(defaultAllowHeaders— theobjectstack dev/servepath)packages/adapters/hono/src/index.ts(same default, kept in sync)Explicit user-supplied
allowHeadersstill win unchanged. New unit test pinsIf-Matchin the default list (16/16 green inplugin-hono-server).Why
The REST record PATCH accepts the OCC token as an
If-Matchheader, and objectui's record-level inline edit (objectui#2407/#2572) sends it on every save. The preflight allow-list omitted it, so on any split-origin deployment — console dev server on one origin, backend on another — the browser failed the CORS preflight and every inline-edit save died withFailed to fetch, while same-origin (/_console) setups never noticed. Same split-origin failure class as the #2548 Bearer fixes.How it was found
Live dogfood of objectui#2572 on the showcase stack: console dev (
:5191, objectui HMR) againstexamples/app-showcase(:4022). The saved-fix stack was then re-verified end-to-end — preflight now returnsaccess-control-allow-headers: …, If-Matchand the atomic inline-edit PATCH (carrying only the edited key +If-Match) succeeds, triggeringshowcase_budget_approvalas designed.🤖 Generated with Claude Code
https://claude.ai/code/session_01JQjNZDdqmz2QHGQndpjZrR
Generated by Claude Code