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 23, 2024
1 parent d215e6e commit 2ea32df
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 2ea32df

Please sign in to comment.