Repository navigation
fix(app-core): preserve middleware RPC exposed headers - #1471
Merged
trueadm merged 4 commits intoOct 1, 2026
Merged
Conversation
trueadm
marked this pull request as ready for review
September 30, 2026 20:41
…eserve-rpc-exposed-headers
…eserve-rpc-exposed-headers
trueadm
added a commit
that referenced
this pull request
Oct 1, 2026
Brings in #1500, #1471, and #1502. #1500 changes vitest.config.js, which every user-app grader digest covers, so manifest.jsonl is regenerated rather than hand-merged. The Strong repair ledger, prompts, and alternatives are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
5 of 6 tasks
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.
Summary
Trusted cross-origin RPC responses overwrite middleware's
Access-Control-Expose-Headers, so browsers cannot read explicitly exposed headers such asRetry-AfterandX-Request-Id. AppendOctane-RPC-Outcometo the existing list instead, preserving middleware visibility and the rejected outcome.Add handler regression coverage and seven real Chromium cases covering explicit/mixed-case lists, wildcard, empty/missing lists, same-origin/native Fetch controls, and blocked untrusted/credentialed preflights. Route the browser project through the existing heavy-browser partition.
Fixes #1361.
Validation
pnpm format:checkpnpm typecheckpnpm testNODE_ENV=developmentandNODE_ENV=production, each runningnode node_modules/vitest/vitest.mjs run --project app-core --project app-core-browser packages/app-core/tests/rpc.test.ts packages/app-core/tests/browser/rpc.test.ts— 62 passed in each mode. Restoring only the RPC implementation from base73138de044b0b08e8873306970c1ec64da0896c3makes six regressions fail in each mode (56 passed).Changed-file Prettier, app-core typecheck, changeset validation/release plan, and
git diff --checkpass. Partition checks collect 55 RPC handler cases in the ordinary project and seven unique browser cases in the heavy project.The full app-core project run in each mode has two failing codegen tests, a Windows symlink
EPERMsetup failure, and its teardown error; all reproduce on the completely unchanged base. Candidate: 220 passed / 6 skipped; base: 209 passed / 6 skipped.pnpm run syncalso fails at the same animejs bindings validation on both revisions without tracked generated changes; later sync stages were not reached. Whole-repository format/type/test commands were not run.Local validation used Windows, Node 24.16.0 and headless Chromium, with a workspace-only hidden-subprocess preload applied consistently to base and candidate runs. That launch instrumentation is not part of this diff.
CI follow-up
Synchronized with upstream main
874ca5f139c6ed6f29b4970a567bc7e22b0b3ca4and regenerated the user-app corpus after this PR's Vitest configuration change. Relative to that merged base, only 21grader.graderDigestvalues change; training data and upstream environment metadata remain unchanged. The two corpus assertions that failed in CI now pass locally (the other four cases were excluded by the focused selection). The RPC handler and headless Chromium suites pass again in development and production (62 tests in each mode).pnpm syncwith pnpm 11.15.1, including nested pnpm commands, stops at the same animejs binding-metadata validation error as an independently checked pristine copy of that upstream commit; later synchronization stages were not reached. Existing dependency views were reused, so the newly merged TanStack dependency patch and full repository installation were not validated locally. Full substantive CI must run on this pushed head.Risk / follow-ups
This preserves middleware's exposure policy, including wildcard behavior; it does not add credentialed CORS support or change origin authorization. Existing case-insensitive outcome names may appear twice in the exposure list, which Fetch handles as a header-name list. No performance improvement is claimed.
Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
The change affects cross-origin RPC CORS header merging, including wildcard expose lists; origin authorization behavior is unchanged but more middleware headers may become visible to trusted browsers.
Overview
Trusted cross-origin RPC responses were replacing middleware
Access-Control-Expose-Headerswith onlyOctane-RPC-Outcome, so browsers could not read headers likeRetry-AfterorX-Request-Ideven when middleware explicitly exposed them.withRpcCorsnow appendsOctane-RPC-Outcometo any existing expose list instead of overwriting it, while still adding CORS allow-origin andVary: Origin.Coverage adds handler regressions (authorization/rate-limit cases, wildcard/empty/missing lists) and a new Playwright/Chromium suite that checks real cross-origin
fetchheader visibility against a native Fetch control. Vitest splitsapp-corenode tests from aapp-core-browserproject on the heavy-browser partition. Evalmanifest.jsonlgrader digests were regenerated after that config change.Reviewed by Cursor Bugbot for commit 7beab06. Bugbot is set up for automated code reviews on this repo. Configure here.