Skip to content

Commit 65fd88b

Browse files
authored
Use explicit ipv4 address isntead of localhost when waiting on URLs (#763)
1 parent fc26429 commit 65fd88b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test-utils/waitForUrls.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ const waitForUrls = async (...urls) => {
66

77
try {
88
return await waitOnAsync({
9-
resources: urls.map((url) => url.replace(/http(s?)\:/, 'http$1-get:')),
9+
resources: urls.map((url) =>
10+
url
11+
.replace(/http(s?)\:/, 'http$1-get:')
12+
// As of node 17, ipv6 is preferred, so explicitly use ipv4
13+
// See https://github.com/jeffbski/wait-on/issues/133
14+
.replace(/localhost/, '127.0.0.1'),
15+
),
1016
headers: { accept: 'text/html, application/javascript' },
1117
timeout,
1218
// Log output of wait behaviour timing to allow

0 commit comments

Comments
 (0)