inspector/clients/web/src/lib
Repository files (latest commit first)
Filename Latest commit message Latest commit date
cliffhall fafc8367b8
fix(web): move the app origin off 6276, bound the publish route
Copilot review round 2 on #2100, plus a collision the review did not find.

The default app-origin port was 6276 — which is already
RUNNER_OAUTH_CALLBACK_DEFAULT_PORT, the CLI/TUI loopback OAuth callback.
That port is fixed precisely so an OAuth app can pre-register
http://127.0.0.1:6276/oauth/callback, which makes it the one listener here
that cannot move when something takes it first. A running --web would hold
it and break a later --cli/--tui OAuth flow at its registered redirect URI,
and docs/mcp-app-review.md has those two running side by side. This
listener has a documented dynamic fallback, so this listener yields: the
default is now 6278 (6277 skipped — v1's retired proxy port, which the
migration guide tells people to stop forwarding). A test asserts the two
defaults stay distinct.

Review comments:

- POST /api/app-document now applies hono's bodyLimit BEFORE parsing. The
  8MiB check ran after c.req.json() had buffered and parsed the whole
  request, and bounded only `html` — so bulk in `csp`, or in keys the route
  never reads, was fully materialized before the 413.
- `csp` is validated as an HTTP header value and length-bounded. The
  controller hands it to res.writeHead() verbatim, where Node throws
  ERR_INVALID_CHAR synchronously — inside the handler for a later,
  unrelated request, outside this route's error handling.
- The app-origin port now propagates everywhere the other two do: the CLI
  --print-handoff port-forward command (and its test), the Dockerfile's ENV
  and EXPOSE, and the remote-review SSH recipe in docs/mcp-app-review.md.
  Without it an app declaring _meta.ui.domain is unreachable through every
  documented remote workflow.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0177mPHAdECD18nLLCTwR5rh
Signed-off-by: cliffhall <cliff@futurescale.com>
2026-08-24 08:45:40 -04:00
..
appElicitationController.test.ts fix(apps): bind app elicitations to the connection that made them 2026-08-22 22:55:43 -04:00
appElicitationController.ts fix(apps): bind app elicitations to the connection that made them 2026-08-22 22:55:43 -04:00
browserTabVisibility.test.ts refactor(web): sharpen the src/lib vs src/utils rule and move misfiled modules (#1784) 2026-07-25 22:24:30 -04:00
browserTabVisibility.ts refactor(web): sharpen the src/lib vs src/utils rule and move misfiled modules (#1784) 2026-07-25 22:24:30 -04:00
clearServerOAuthState.test.ts refactor(web): sharpen the src/lib vs src/utils rule and move misfiled modules (#1784) 2026-07-25 22:24:30 -04:00
clearServerOAuthState.ts refactor(web): sharpen the src/lib vs src/utils rule and move misfiled modules (#1784) 2026-07-25 22:24:30 -04:00
downloadFile.test.ts refactor(web): sharpen the src/lib vs src/utils rule and move misfiled modules (#1784) 2026-07-25 22:24:30 -04:00
downloadFile.ts refactor(web): rename "History" tab/feature to "Protocol" (#1623) 2026-07-09 19:04:54 -04:00
environmentFactory.test.ts refactor: migrate to RemoteOAuthStorage for web OAuth handling 2026-07-03 13:11:13 -07:00
environmentFactory.ts refactor: migrate to RemoteOAuthStorage for web OAuth handling 2026-07-03 13:11:13 -07:00
oauthResume.test.ts fix(web): drop a pre-#2001 selectedToolName on OAuth resume 2026-08-17 00:19:22 -04:00
oauthResume.ts fix(web): drop a pre-#2001 selectedToolName on OAuth resume 2026-08-17 00:19:22 -04:00
publishAppDocument.test.ts fix(web): move the app origin off 6276, bound the publish route 2026-08-24 08:45:40 -04:00
publishAppDocument.ts feat(web): honor _meta.ui.domain with a dedicated app origin 2026-08-24 08:45:40 -04:00
refreshingPersist.test.ts fix(auth): stop a config-only PUT deleting stored secrets (#2084) 2026-08-22 23:30:17 -04:00
refreshingPersist.ts fix(auth): stop a config-only PUT deleting stored secrets (#2084) 2026-08-22 23:30:17 -04:00
remoteOAuthStorage.test.ts refactor: migrate to RemoteOAuthStorage for web OAuth handling 2026-07-03 13:11:13 -07:00
remoteOAuthStorage.ts fix(auth): guard OAuth-storage async paths against unhandled rejections 2026-07-08 10:59:40 -04:00