Skip to content

Commit 0e5af66

Browse files
committed
added comments'
1 parent b68d8b1 commit 0e5af66

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/util/src/url.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
* @public
2121
*/
2222
export function isCloudWorkstation(url: string): boolean {
23+
// `isCloudWorkstation` is called without protocol in certain connect*Emulator functions
24+
// In HTTP request builders, it's called with the protocol.
25+
// If called with protocol prefix, it's a valid URL, so we extract the hostname
26+
// If called without, we assume the string is the hostname.
2327
const host =
2428
url.startsWith('http://') || url.startsWith('https://')
2529
? new URL(url).hostname

0 commit comments

Comments
 (0)