Skip to content

fix: preserve path, query, and fragment in proxy URLs (#7668) - #8012

Open
yykaue wants to merge 1 commit into
coder:mainfrom
yykaue:fix-7668-preserve-proxy-url
Open

yykaue wants to merge 1 commit into
coder:mainfrom
yykaue:fix-7668-preserve-proxy-url

Conversation

@yykaue

@yykaue yykaue commented Sep 17, 2026

Copy link
Copy Markdown

Fixes #7668

Localhost URLs opened through browser.sh lose their original path when rewritten through the port proxy. Query parameters and fragments are also discarded.

This change appends the original path to the proxy base and preserves the query and fragment using URI components. It supports proxy templates with or without a trailing slash and avoids double encoding.

For example:

  • Before: http://127.0.0.1:1234/my/path?q=1#section/proxy/1234/
  • After: http://127.0.0.1:1234/my/path?q=1#section/proxy/1234/my/path?q=1#section

Added end-to-end regression coverage for default, relative, and subdomain proxy templates, including encoded characters.

Validation:

  • All 13 isolated reproduction cases passed.
  • Patch application, Prettier, ESLint, and changed-file TypeScript checks passed.
  • Full test-project TypeScript diagnostics are unchanged from main.
  • Full end-to-end tests were not run because a VS Code build was unavailable.

@yykaue
yykaue requested a review from a team as a code owner September 17, 2026 07:52
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.

localhost openExternal rewrite loses URL /path

1 participant