Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitabb3df7

Browse files
fix(site): avoid constructing invalid apps url (#15711)
In Firefox, parsing a URL containing a `*` returns an error:```new URL("https://*--apps.sydney.fly.dev.coder.com") ``````Uncaught TypeError: URL constructor: https://*--apps.sydney.fly.dev.coder.com is not a valid URL. <anonymous> debugger eval code:1```In Chrome and Node, this same URL does not produce an error.This causes a workspace dashboard with apps to fail to load on Firefox.![image](https://github.com/user-attachments/assets/eeea4fe5-3759-432b-b7ce-22dfad5f8218)
1 parent3014713 commitabb3df7

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

‎site/src/utils/apps.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ export const createAppLinkHref = (
2929
}
3030

3131
if(appsHost&&app.subdomain&&app.subdomain_name){
32-
constbaseUrl=`${protocol}//${appsHost}`;
32+
constbaseUrl=`${protocol}//${appsHost.replace("*",app.subdomain_name)}`;
3333
consturl=newURL(baseUrl);
34-
url.hostname=appsHost.replace("*",app.subdomain_name);
3534
url.pathname="/";
3635

3736
href=url.toString();

‎site/src/utils/portForward.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ export const portForwardURL = (
1313

1414
constsubdomain=`${port}${suffix}--${agentName}--${workspaceName}--${username}`;
1515

16-
constbaseUrl=`${location.protocol}//${host}`;
16+
constbaseUrl=`${location.protocol}//${host.replace("*",subdomain)}`;
1717
consturl=newURL(baseUrl);
18-
url.hostname=host.replace("*",subdomain);
1918

2019
returnurl.toString();
2120
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp