Title: [Bug]: --trusted-origins entries with uppercase letters never match · Issue #8124 · coder/code-server · GitHub
Open Graph Title: [Bug]: --trusted-origins entries with uppercase letters never match · Issue #8124 · coder/code-server
X Title: [Bug]: --trusted-origins entries with uppercase letters never match · Issue #8124 · coder/code-server
Description: Is there an existing issue for this? I have searched the existing issues OS/Web Information Web Browser: not needed, reproduced with the unit tests Local OS: Windows 11 Remote OS: Windows 11 Remote Architecture: x64 code-server --version...
Open Graph Description: Is there an existing issue for this? I have searched the existing issues OS/Web Information Web Browser: not needed, reproduced with the unit tests Local OS: Windows 11 Remote OS: Windows 11 Remote...
X Description: Is there an existing issue for this? I have searched the existing issues OS/Web Information Web Browser: not needed, reproduced with the unit tests Local OS: Windows 11 Remote OS: Windows 11 Remote...
Opengraph URL: https://github.com/coder/code-server/issues/8124
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: --trusted-origins entries with uppercase letters never match","articleBody":"### Is there an existing issue for this?\n\n- [x] I have searched the existing issues\n\n### OS/Web Information\n\n- Web Browser: not needed, reproduced with the unit tests\n- Local OS: Windows 11\n- Remote OS: Windows 11\n- Remote Architecture: x64\n- `code-server --version`: `main` at 568a58f\n\n### Steps to Reproduce\n\n1. Set `--trusted-origins` to an entry with an uppercase letter, for example the default Windows host name `DESKTOP-ABC123:8080`.\n2. Send a request with `Origin: http://desktop-abc123:8080` to a code-server whose host is something else (`other.com`). I checked this with `authenticateOrigin()` and the mock requests that `test/unit/node/http.test.ts` uses for the origin check.\n\n### Expected\n\nHost names are not case sensitive, so the entry `DESKTOP-ABC123:8080` trusts the origin `http://desktop-abc123:8080`, as a `*.Example.com` entry already trusts `http://sub.example.com`.\n\n### Actual\n\n`authenticateOrigin()` throws `host \"other.com\" does not match origin \"desktop-abc123:8080\"`, so web sockets and proxied requests from that origin get a 403.\n\n`authenticateOrigin()` lowercases the host of the `Origin` header (browsers send it in lowercase anyway), and `isTrustedOrigin()` lowercases the domain of a `*.example.com` entry, but it compares an exact entry as written:\n\n```ts\nif (trusted === \"*\" || trusted === origin) {\n```\n\nSo an exact `--trusted-origins` entry with any uppercase letter never matches.\n\n### Logs\n\nNot applicable.\n\n### Screenshot/Video\n\n_No response_\n\n### Does this bug reproduce in native VS Code?\n\nThis cannot be tested in native VS Code\n\n### Does this bug reproduce in VS Code web?\n\nThis cannot be tested in VS Code web\n\n### Does this bug reproduce in GitHub Codespaces?\n\nThis cannot be tested in GitHub Codespaces\n\n### Are you accessing code-server over a secure context?\n\n- [ ] I am using a secure context.\n\n### Notes\n\nI am opening a PR that compares exact entries in lowercase, with tests.\n\nAI-assisted: found and reproduced with an AI coding agent; the check above was run locally.\n","author":{"url":"https://github.com/adityajai119","@type":"Person","name":"adityajai119"},"datePublished":"2026-11-12T18:37:11Z","url":"https://github.com/coder/code-server/issues/8124"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3bf1e278-372d-5202-62da-2fceed566a2c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 880C:215B92:2D96452:3CBB05C:6B01D4BB |
| html-safe-nonce | 803e287076aaf61280421ddb5d29c9744d83fcbb1cf523e26faaa1559faeb41b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODBDOjIxNUI5MjoyRDk2NDUyOjNDQkIwNUM6NkIwMUQ0QkIiLCJ2aXNpdG9yX2lkIjoiMjAxNzkzMTc0NjYzMjM4OTgxOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 722a4cfac70c5777e9571dd727ca5c49716be5f09e1597a310a7f3bb4fa3191a |
| hovercard-subject-tag | issue:6356561044 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/code-server/8124/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1091f4d9cc307db26e6c4fd9e59a788772c69dff2b4f77933291797fdeeeda96/coder/code-server/issues/8124 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1091f4d9cc307db26e6c4fd9e59a788772c69dff2b4f77933291797fdeeeda96/coder/code-server/issues/8124 |
| og:image:alt | Is there an existing issue for this? I have searched the existing issues OS/Web Information Web Browser: not needed, reproduced with the unit tests Local OS: Windows 11 Remote OS: Windows 11 Remote... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | adityajai119 |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/code-server git https://github.com/coder/code-server.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 172953845 |
| octolytics-dimension-repository_nwo | coder/code-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 172953845 |
| octolytics-dimension-repository_network_root_nwo | coder/code-server |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width