tinymist/crates
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
..
crityp fix: update cargo metadata and crate release script (#2073) 2025-08-25 03:03:55 +08:00
sync-lsp docs: document all public items in rust codebase (#2058) 2025-08-21 12:50:03 +08:00
tinymist fix: extend origin check for vscode servers (#2106) 2025-09-14 08:08:30 +08:00
tinymist-analysis dev: drop if_chain and collapse if statements (#2097) 2025-09-01 16:46:54 +08:00
tinymist-assets docs: document all public items in rust codebase (#2058) 2025-08-21 12:50:03 +08:00
tinymist-cli feat: enhance CLI and argument documentation (#2072) 2025-09-03 17:02:42 +08:00
tinymist-dap feat: bump edition of most crates to rust 2024 (#2042) 2025-08-18 16:48:41 +08:00
tinymist-debug dev: drop if_chain and collapse if statements (#2097) 2025-09-01 16:46:54 +08:00
tinymist-derive build: bump version to 0.13.24 (#2085) 2025-08-26 16:15:03 +08:00
tinymist-l10n build: bump version to 0.13.24 (#2085) 2025-08-26 16:15:03 +08:00
tinymist-lint dev: drop if_chain and collapse if statements (#2097) 2025-09-01 16:46:54 +08:00
tinymist-package build: bump version to 0.13.24 (#2085) 2025-08-26 16:15:03 +08:00
tinymist-project feat: enhance CLI and argument documentation (#2072) 2025-09-03 17:02:42 +08:00
tinymist-query dev: drop if_chain and collapse if statements (#2097) 2025-09-01 16:46:54 +08:00
tinymist-render fix: eliminate clippy warnings (#2036) 2025-08-18 12:42:03 +08:00
tinymist-std build: bump version to 0.13.24 (#2085) 2025-08-26 16:15:03 +08:00
tinymist-task build: bump version to 0.13.24 (#2085) 2025-08-26 16:15:03 +08:00
tinymist-tests feat: bump edition of most crates to rust 2024 (#2042) 2025-08-18 16:48:41 +08:00
tinymist-vfs build: bump version to 0.13.24 (#2085) 2025-08-26 16:15:03 +08:00
tinymist-world feat: enhance CLI and argument documentation (#2072) 2025-09-03 17:02:42 +08:00
typlite build: update readme docs (#2114) 2025-09-12 00:50:56 +08:00
typst-preview feat: enhance CLI and argument documentation (#2072) 2025-09-03 17:02:42 +08:00
typst-shim build: bump version to 0.13.24 (#2085) 2025-08-26 16:15:03 +08:00