Skip to content

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

Merged
code-asher merged 1 commit into
coder:mainfrom
yykaue:fix-7668-preserve-proxy-url
Sep 17, 2026
Merged

code-asher merged 1 commit into
coder:mainfrom
yykaue:fix-7668-preserve-proxy-url

Conversation

@yykaue

@yykaue yykaue commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Fixes #7668
Fixes #7573

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

@code-asher code-asher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome thank you!

@code-asher
code-asher merged commit ef5eba4 into coder:main Sep 17, 2026
19 of 20 checks passed
@yykaue
yykaue deleted the fix-7668-preserve-proxy-url branch September 18, 2026 01:06
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 URL translation via VSCODE_PROXY_URI drops query parameters

2 participants