-
Notifications
You must be signed in to change notification settings - Fork 3k
feat(serve): support HTTPS/TLS via --tls-cert and --tls-key flags #6032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
31dc268
ad66336
80174cc
c3bc562
e2c4789
d1a9ced
0f5d52c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -139,10 +139,15 @@ const WS_READ_METHODS = new Set([ | |||||||
| function isSameLoopbackOrigin(origin: string, localPort?: number): boolean { | ||||||||
| if (!localPort) return false; | ||||||||
| const parsed = new URL(origin); | ||||||||
| // Both schemes: under `--tls-cert/--tls-key` the loopback ACP client | ||||||||
| // speaks https, so its Origin header carries `https://`. | ||||||||
| const allowed = new Set([ | ||||||||
|
pomelo-nwu marked this conversation as resolved.
|
||||||||
| `http://localhost:${localPort}`, | ||||||||
| `http://127.0.0.1:${localPort}`, | ||||||||
| `http://[::1]:${localPort}`, | ||||||||
| `https://localhost:${localPort}`, | ||||||||
| `https://127.0.0.1:${localPort}`, | ||||||||
| `https://[::1]:${localPort}`, | ||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] The WS Host header allowlist later in this same file (line ~674) includes Concrete effect: a Docker-hosted browser connecting over HTTPS can make REST requests (the self-origin strip removes the Origin header before CORS runs) and passes the WS Host check — but its WS upgrade is rejected by this Origin check with a 403. The operator has no obvious workaround path without
Suggested change
And in the port-443 block, add for (const host of ['localhost', '127.0.0.1', '[::1]', 'host.docker.internal']) {— qwen3.7-max via Qwen Code /review |
||||||||
| ]); | ||||||||
| return allowed.has(parsed.origin.toLowerCase()); | ||||||||
| } | ||||||||
|
|
||||||||
Uh oh!
There was an error while loading. Please reload this page.