-
Notifications
You must be signed in to change notification settings - Fork 2.2k
sync #2701
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
Closed
Closed
sync #2701
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2c175fd
chore: add workspace root as explicit dependency
Jish2 eff1e1b
chore(turbo): hash T3CODE_HOST and VITE_HTTP_URL for task cache
Jish2 8299154
fix(dev-runner): forward HOST to Vite and keep inherited T3CODE_NO_BR…
Jish2 d047508
feat(server): allowlist credentialed browser API CORS origins
Jish2 e03e052
fix(web): fix Vite listen host and HMR client when binding 0.0.0.0
Jish2 1d3f505
fix(web): rewrite loopback configured API URLs to the page hostname
Jish2 ea17fca
fix cors issue
Jish2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| import { afterEach, describe, expect, it, vi } from "vitest"; | ||
|
|
||
| import { readPrimaryEnvironmentTarget } from "./target"; | ||
|
|
||
| describe("readPrimaryEnvironmentTarget", () => { | ||
| afterEach(() => { | ||
| vi.unstubAllEnvs(); | ||
| vi.unstubAllGlobals(); | ||
| }); | ||
|
|
||
| it("rewrites loopback configured URLs to the page hostname for LAN-style access", () => { | ||
| vi.stubEnv("VITE_HTTP_URL", "http://localhost:13773"); | ||
| vi.stubEnv("VITE_WS_URL", "ws://localhost:13773"); | ||
| vi.stubGlobal("window", { | ||
| location: new URL("http://100.64.0.2:5733/"), | ||
| desktopBridge: undefined, | ||
| }); | ||
|
|
||
| const target = readPrimaryEnvironmentTarget(); | ||
| expect(target).toEqual({ | ||
| source: "configured", | ||
| target: { | ||
| httpBaseUrl: "http://100.64.0.2:13773/", | ||
| wsBaseUrl: "ws://100.64.0.2:13773/", | ||
| }, | ||
| }); | ||
| }); | ||
|
|
||
| it("does not rewrite when the page is served from loopback", () => { | ||
| vi.stubEnv("VITE_HTTP_URL", "http://localhost:13773"); | ||
| vi.stubEnv("VITE_WS_URL", "ws://localhost:13773"); | ||
| vi.stubGlobal("window", { | ||
| location: new URL("http://127.0.0.1:5733/"), | ||
| desktopBridge: undefined, | ||
| }); | ||
|
|
||
| const target = readPrimaryEnvironmentTarget(); | ||
| expect(target).toEqual({ | ||
| source: "configured", | ||
| target: { | ||
| httpBaseUrl: "http://localhost:13773/", | ||
| wsBaseUrl: "ws://localhost:13773/", | ||
| }, | ||
| }); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IPv6 hostname rewrite silently fails due to missing brackets
Low Severity
When the page is accessed via an IPv6 address (e.g.,
http://[fd00::1]:5733/),pageHostnamewill befd00::1(the WHATWG URL getter strips brackets). Assigning this unbracketed IPv6 value viaurl.hostname = pageHostnameis a silent no-op in the WHATWG URL API, because the colon is a forbidden domain code point and host parsing fails. The rewrite never actually takes effect for IPv6, leaving the URL pointing at localhost.Additional Locations (1)
apps/web/src/environments/primary/target.ts#L104-L105Reviewed by Cursor Bugbot for commit ea17fca. Configure here.