Skip to content

localhost openExternal rewrite loses URL /path #7668

Closed

Description

@anguslees

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: chrome
  • Local OS: macOS
  • Remote OS: Linux/Ubuntu
  • Remote Architecture: amd64
  • code-server --version: 1.107.0

Steps to Reproduce

  1. /usr/lib/code-server/lib/vscode/bin/helpers/browser.sh http://127.0.0.1:1234/my/path
  2. Opens URL https://coder.<domain>/@<user>/<instance>/apps/code-server/proxy/1234/
  3. Be saddened by the observation that /my/path was dropped during the rewrite.

Expected

Should have rewritten to URL https://coder.<domain>/@<user>/<instance>/apps/code-server/proxy/1234/my/path (with trailing /my/path). When I update the URL in my browser to do this, this works - so the proxy itself is doing all the right things, it's just the rewrite that is incorrect afaics.

I have not explored with query params or anchors. Given what I see in the code, I suspect these are lost too.

Actual

Opened URL https://coder.<domain>/@<user>/<instance>/apps/code-server/proxy/1234/

Logs

Screenshot/Video

No response

Does this bug reproduce in native VS Code?

This cannot be tested in native VS Code

Does this bug reproduce in VS Code web?

I did not test VS Code web

Does this bug reproduce in GitHub Codespaces?

I did not test GitHub Codespaces

Are you accessing code-server over a secure context?

  • I am using a secure context.

Notes

I believe the relevant code is part of this code-server patch, and not vscode:
https://github.com/coder/code-server/blob/main/patches/proxy-uri.diff

From a squint at this patch, I think the new URL(renderedTemplate, window.location.href) call in resolveExternalUri is suspect. I don't see anything here that would copy through anything after the host portion of the URL.

Activity

  1. added
    bugSomething isn't working
    triageThis issue needs to be triaged by a maintainer
    on Feb 10, 2026
  2. anguslees commented on Feb 10, 2026

    @anguslees
    Author

    Based on my analysis, this can be resolved by addressing the core issue.

    You're absolutely right! This is a key insight! Thanks, AI.

  3. code-asher commented on Mar 2, 2026

    @code-asher
    Member

    From a squint at this patch, I think the new URL(renderedTemplate, window.location.href) call in resolveExternalUri is suspect. I don't see anything here that would copy through anything after the host portion of the URL.

    That makes sense to me as well, we need to explicitly maintain the path and params.

  4. yykaue commented on Sep 17, 2026

    @yykaue
    Contributor

    /assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageThis issue needs to be triaged by a maintainer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions