localhost openExternal rewrite loses URL /path
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- web-dev
Research direction
Start with patches/proxy-uri.diff and the resolveExternalUri call identified in the report; reproduce the behavior with the browser.sh command and the URL containing /my/path. Check how the rewritten URL handles the path, then verify query parameters and anchors as well. Done means the rewritten proxy URL preserves the original URL suffix.
Written by the indexing model from the issue text.
Description
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
/usr/lib/code-server/lib/vscode/bin/helpers/browser.sh http://127.0.0.1:1234/my/path- Opens URL
https://coder.<domain>/@<user>/<instance>/apps/code-server/proxy/1234/ - Be saddened by the observation that
/my/pathwas 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.
- Dominant language
- TypeScript
- Stars
- 79.4k
- Forks
- 6.9k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 39
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from coder/code-server
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
coder/code-server#8017 · 2 comments ·
-
security
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
coder/code-server#8013 · 4 comments ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
coder/code-server#7976 · 2 comments ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
coder/code-server#7962 · 3 comments ·
-
bug needs-investigation
Difficulty 4/5 3-5 days Newbie friendliness 55/100
coder/code-server#7955 · 1 comment ·
All issues in coder/code-server
Similar issues
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Mend: dependency security vulnerability untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 70/100