Repository navigation
Conversation
…upgrading old Vite A refused /__dd request now logs at warn the first time its Host and reason are seen by a dev server, and at debug after that, so a developer behind a tunnel or LAN hostname sees why the request failed. The set of warned rejections is capped per dev server, with one notice once the cap is reached. The host-not-allowed message also tells users of Vite 5 before 5.4.12 or Vite 6 before 6.0.9, which lack server.allowedHosts, to upgrade. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6006175 to
2a84069
Compare
|
@codex review |
There was a problem hiding this comment.
🟢 Approval recommended
The focused logging and message changes have targeted test coverage and no identified blocking issues.
0 open findings
What changed in this PR
Improves visibility of rejected requests to the apps plugin’s Vite dev-server routes without flooding default logs.
Changes:
- Warns once per Host/reason pair, with a per-server cap and debug logging afterward.
- Adds stable rejection reasons and upgrade guidance for older Vite versions.
- Tests deduplication, warning limits, instance isolation, and credential exclusion.
| File | Description |
|---|---|
| packages/plugins/apps/src/vite/dev-server.ts | Adds bounded, per-server refusal warnings. |
| packages/plugins/apps/src/vite/dev-server.test.ts | Tests refusal logging and deduplication. |
| packages/plugins/apps/src/vite/dev-server-request-guard.ts | Adds rejection reasons, shared Host extraction, and upgrade guidance. |
| packages/plugins/apps/src/vite/dev-server-request-guard.test.ts | Verifies rejection reasons and guidance. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Motivation
debug, below the defaultlogLevelofwarn, so a developer behind a tunnel or LAN hostname sees a 403 and nothing in the terminal.server.allowedHosts, which Vite 5 before 5.4.12 and Vite 6 before 6.0.9 lack.Changes
6 changes across dev-server.ts, dev-server-request-guard.ts and their tests
debug.dev-server.tsMAX_WARNED_REJECTIONS(32) per dev server, with one notice.dev-server.tsreasontoRequestRejectionand exportsgetRequestHost.dev-server-request-guard.tsALLOWED_HOSTS_HINTandVITE_UPGRADE_HINT.dev-server-request-guard.tsdev-server.test.tsreasonand the upgrade hint.dev-server-request-guard.test.tsQA Instructions
Real
vite devrun: script, app files and outputqa-guard-logging.sh:app/index.html:app/main.js:app/backend/greet.backend.ts:app/vite.config.mjs:loopback-only.cjs:QA_LOG_LEVEL=debug:cap-29carries the notice.Blast Radius
/__ddroutes change.warnline, at most 33 per dev server.Documentation
server.allowedHosts🤖 Generated with Claude Code