coder / coder/code-server

localhost openExternal rewrite loses URL /path

オープン
#7,668 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug triage
主要言語
TypeScript
スター
79.3k
フォーク
6.8k
平均マージ
2日 6時間
マージ済み PR(30日)
41

説明

### Is there an existing issue for this?

- [x] 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./@//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./@//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./@//apps/code-server/proxy/1234/`

### Logs

```shell

```

### 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?

- [x] 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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。