Skip to content

[codex] fix: preserve localhost preview hosts#2

Merged
StiensWout merged 1 commit into
staging/fix-localhost-preview-host-preservationfrom
codex/fix/fix-localhost-preview-host-preservation
Jun 22, 2026
Merged

[codex] fix: preserve localhost preview hosts#2
StiensWout merged 1 commit into
staging/fix-localhost-preview-host-preservationfrom
codex/fix/fix-localhost-preview-host-preservation

Conversation

@StiensWout

Copy link
Copy Markdown
Owner

Summary

  • Preserve normalized localhost discovered preview URLs when the prepared connection itself is local loopback.
  • Keep 0.0.0.0 flowing through the existing environment-port normalization path.
  • Keep private remote host remapping for discovered loopback ports.

Root cause

resolveDiscoveredServerUrl(...) treated every loopback discovered URL as an environment-port target. When the prepared connection base was http://127.0.0.1:<port>, that remapped localhost:<port> onto 127.0.0.1:<port>, even though the normalized user-visible URL should stay on localhost.

Impact

Users opening a discovered localhost dev server from a local prepared environment keep the localhost host, which preserves host-specific API allowlists. Wildcard local hosts such as 0.0.0.0 still normalize to a concrete reachable host, and private remote environments still remap discovered loopback ports onto the private environment host.

Validation

  • PATH="$HOME/.vite-plus/bin:$PATH" vp test apps/web/src/browser/browserTargetResolver.test.ts
  • PATH="$HOME/.vite-plus/bin:$PATH" vp check
  • PATH="$HOME/.vite-plus/bin:$PATH" vp run typecheck

vp check reports the repository's existing lint warnings and no errors.

Closes pingdotgg#3124

Co-authored-by: Codex <codex@openai.com>
@StiensWout
StiensWout merged commit e581f07 into staging/fix-localhost-preview-host-preservation Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant