tinymist/editors
Allan Chain 22089e5e27
fix: extend origin check for vscode servers (#2106)
Previously, Tinymist preview does not work on VS Code web (code-server)
because it tries to connect to the `localhost`, which is impossible
since we are doing remote development.

Even if we fix this error, the HTTP origin check will also fail because
the domain of our VS Code web is not trusted by Tinymist. One possible
fix is to grab the `VSCODE_PROXY_URI` environment variable and check if
the incoming request matches the URI. This will fix the issue for most
standard code-server installations.

However, GitHub Codespace is an exception. I did some logging, and found
that GitHub Codespace used different origins:
- `<random>.assets.github.dev`
- `https://localhost:<port>` (note HTTP**S**)
- `None`

This is very weird and difficult to debug. Moreover, the ports forwarded
by GitHub Codespaces require authentication before visiting, which the
VS Code webview does not support. One have to open the URL in another
browser tab to authenticate. This is frustrating and is difficult to
workaround. Therefore, currently, GitHub Codespaces are not supported.

(I asked LLM to generate some of the Rust code. It works, but may need
improvements.)

Fixes #625
2025-09-14 08:08:30 +08:00
..
emacs docs: update commands to install tinymist cli (#2037) 2025-08-18 07:17:33 +08:00
helix docs: update commands to install tinymist cli (#2037) 2025-08-18 07:17:33 +08:00
neovim build: bump version to 0.13.26 (#2119) 2025-09-13 10:52:34 +08:00
sublime-text feat: finally directly generate markdown files (#1881) 2025-07-07 13:11:23 +08:00
vscode fix: extend origin check for vscode servers (#2106) 2025-09-14 08:08:30 +08:00
zed feat: finally directly generate markdown files (#1881) 2025-07-07 13:11:23 +08:00