Skip to content

Commit 61636af

Browse files
authored
fix: remove square brackets from ipv6 hostnames (#235)
1 parent b02df77 commit 61636af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/core/src/utils/fetch.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ export async function fetch<T>(
147147
).hostname;
148148

149149
const requestParams: RequestOptions = {
150-
host: url.hostname, // IP
150+
// for ipv6 remove square brackets as they come due to url standard
151+
host: url.hostname.replace(/^\[|\]$/g, ''), // IP
151152
port: url.port,
152153
method: options.method,
153154
path: url.pathname + url.search,

0 commit comments

Comments
 (0)