Fix CORS_ORIGIN wildcard patterns in @objectstack/hono adapter#1178
Merged
xuyushun441-sys merged 1 commit intomainfrom Apr 17, 2026
Merged
Fix CORS_ORIGIN wildcard patterns in @objectstack/hono adapter#1178xuyushun441-sys merged 1 commit intomainfrom
xuyushun441-sys merged 1 commit intomainfrom
Conversation
…oApp Agent-Logs-Url: https://github.com/objectstack-ai/framework/sessions/ed3eba80-26bc-4802-a749-a8441033eaf0 Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
xuyushun441-sys
April 17, 2026 11:10
View session
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
PR #1177 unified wildcard matching across the Vercel OPTIONS short-circuit and
plugin-hono-server, but missed a third path:createHonoApp()in@objectstack/hono. Sinceapps/serverroutes all non-OPTIONS traffic through this adapter on Vercel, preflights succeeded but the ensuing POST/GET responses shipped withoutAccess-Control-Allow-Origin— the browser blocked every real request.Root cause
createHonoApp()passedCORS_ORIGINstraight into Hono'scors()middleware, which does exact-string comparison and treats*as a literal character:Changes
packages/adapters/hono/src/index.ts— detect wildcard patterns viahasWildcardPatternand swap in acreateOriginMatcherfunction for Hono'soriginoption. Branch logic mirrorsplugin-hono-serverexactly, preserving the single source of truth established in Fix CORS_ORIGIN wildcard patterns on Vercel deployments #1177.packages/adapters/hono/package.json— add workspace dep on@objectstack/plugin-hono-server(no cycle; the plugin depends only oncore+spec).packages/adapters/hono/src/hono.test.ts— 5 new tests covering subdomain wildcards, port wildcards, comma-separated lists, rejection of unmatched origins, and wildcard preflight.CHANGELOG.md— follow-up entry under Unreleased / Fixed.Invariant worth preserving
All three Hono-based CORS sites must route wildcard handling through
@objectstack/plugin-hono-server:apps/server/server/index.ts— Vercel OPTIONS short-circuitpackages/plugins/plugin-hono-server/src/hono-plugin.tspackages/adapters/hono/src/index.ts—createHonoApp()← this PRAny future CORS change needs to touch all three or risk the same split-brain failure mode.