Skip to content

Commit

Permalink
Cover condition for socketURL when returns empty string and pass cond…
Browse files Browse the repository at this point in the history
…ition for / assetPrefix
  • Loading branch information
kjugi committed Jul 19, 2024
1 parent 94bbf32 commit 7774585
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function getSocketUrl(assetPrefix: string): string {
const protocol = getSocketProtocol(assetPrefix)
const prefix = normalizedAssetPrefix(assetPrefix)

let url = `${protocol}://${hostname}:${port}${prefix ? `/${prefix}` : ''}`
let url = `${protocol}://${hostname}:${port}${prefix && prefix !== '' ? `/${prefix}` : ''}`

if (prefix.startsWith('http')) {
url = `${protocol}://${prefix.split('://', 2)[1]}`
Expand Down

0 comments on commit 7774585

Please sign in to comment.