Repository navigation
Conversation
Hardcoded Google STUN servers exposed user IPs and prevented customisation. Resolve the ICE server list from the VITE_ICE_SERVERS env var (a JSON array of RTCIceServer objects), parsing defensively and falling back to the previous Google STUN list when unset or invalid. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Automated self-review verdict: NEEDS_CHANGES (code-reviewer, separate invocation from the implementer). Blocking: Fix: validate each element is a non-null object with a string/array Non-blocking: |
Harden resolveIceServers() so valid JSON of the wrong shape (string
elements, [{}], [1,2,3]) can no longer escape the try/catch and throw
uncaught at RTCPeerConnection construction. Each element is now validated
to be a non-null object with a urls field that is a non-empty string or
array of strings; any failure falls back to the default Google STUN list.
Also declare VITE_ICE_SERVERS on ImportMetaEnv, export the helper and
DEFAULT_ICE_SERVERS, and add Vitest coverage for unset, valid, malformed
and wrong-shape inputs.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Closing as a duplicate. An earlier, more complete PR for #626 already exists: #714 (branch #714 has a dedicated, well-tested This PR (#733) was opened by an automated run that missed the pre-existing #714; it does not add anything #714 lacks and shares the same unresolved runtime-config gap. Consolidating on #714 so the review history and analysis stay in one place. |
Summary
use-rtc-connection.ts, leaking user IPs to Google and preventing customisation (Security: Hardcoded Google STUN servers expose user IPs and prevent customisation #626).resolveIceServers()helper that readsVITE_ICE_SERVERS(a JSON array ofRTCIceServerobjects).JSON.parseis wrapped in try/catch and a non-empty-array check; on any error it logs a warning and uses the fallback, so a malformed value never throws on the connection path.README.mdand.env.local.sample.Test plan
npm test)npm run typecheck)npm run lint)Closes #626
🤖 Generated with Claude Code