Skip to content

fix(hono): allow If-Match in default CORS headers so cross-origin OCC saves work (objectui#2572)#3067

Merged
os-zhuang merged 1 commit into
mainfrom
claude/record-inline-edit-polish-ns7mes
Jul 16, 2026
Merged

fix(hono): allow If-Match in default CORS headers so cross-origin OCC saves work (objectui#2572)#3067
os-zhuang merged 1 commit into
mainfrom
claude/record-inline-edit-polish-ns7mes

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

What

Adds If-Match to the default CORS allowHeaders in both places the default list lives:

  • packages/plugins/plugin-hono-server/src/hono-plugin.ts (defaultAllowHeaders — the objectstack dev/serve path)
  • packages/adapters/hono/src/index.ts (same default, kept in sync)

Explicit user-supplied allowHeaders still win unchanged. New unit test pins If-Match in the default list (16/16 green in plugin-hono-server).

Why

The REST record PATCH accepts the OCC token as an If-Match header, 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 with Failed 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) against examples/app-showcase (:4022). The saved-fix stack was then re-verified end-to-end — preflight now returns access-control-allow-headers: …, If-Match and the atomic inline-edit PATCH (carrying only the edited key + If-Match) succeeds, triggering showcase_budget_approval as designed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JQjNZDdqmz2QHGQndpjZrR


Generated by Claude Code

… 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
@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Building Building Preview, Comment Jul 16, 2026 2:29pm

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling labels Jul 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): packages/adapters, @objectstack/plugin-hono-server.

5 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/getting-started/your-first-project.mdx (via @objectstack/plugin-hono-server)
  • content/docs/permissions/authentication.mdx (via @objectstack/plugin-hono-server)
  • content/docs/plugins/index.mdx (via @objectstack/plugin-hono-server)
  • content/docs/plugins/packages.mdx (via packages/adapters, @objectstack/plugin-hono-server)
  • content/docs/releases/implementation-status.mdx (via @objectstack/plugin-hono-server)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@os-zhuang
os-zhuang marked this pull request as ready for review July 16, 2026 14:42
@os-zhuang
os-zhuang merged commit ef50372 into main Jul 16, 2026
15 of 16 checks passed
@os-zhuang
os-zhuang deleted the claude/record-inline-edit-polish-ns7mes branch July 16, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants