Skip to content

Commit

Permalink
fix(core): ensure localhost:port is prefixed with http://
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed May 12, 2023
1 parent 412e6df commit 65a389f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ export const hashPathName = (path: string) => {
* @param host
*/
export const normaliseHost = (host: string) => {
if (!hasProtocol(host))
if (!host.startsWith('http'))
host = `http${host.startsWith('localhost') ? '' : 's'}://${host}`
return withTrailingSlash(host)
return host.includes('.') ? host : withTrailingSlash(host)
}

/**
Expand Down

0 comments on commit 65a389f

Please sign in to comment.