feat: link with protocol on shared ports (#12908)

This commit is contained in:
Garrett Delfosse
2024-04-10 09:29:24 -04:00
committed by GitHub
parent 2f2a395ba9
commit acaa254099
6 changed files with 15 additions and 9 deletions
@@ -393,6 +393,7 @@ export const PortForwardPopoverView: FC<PortForwardPopoverViewProps> = ({
agent.name,
workspaceName,
username,
share.protocol === "https",
);
const label = share.port;
return (
+3 -3
View File
@@ -4,12 +4,12 @@ export const portForwardURL = (
agentName: string,
workspaceName: string,
username: string,
https = false,
): string => {
const { location } = window;
const suffix = https ? "s" : "";
const subdomain = `${
isNaN(port) ? 3000 : port
}--${agentName}--${workspaceName}--${username}`;
const subdomain = `${port}${suffix}--${agentName}--${workspaceName}--${username}`;
return `${location.protocol}//${host}`.replace("*", subdomain);
};