Skip to content

Commit

Permalink
Use 127.0.0.1 instead of localhost
Browse files Browse the repository at this point in the history
This resolves an error we were experiencing in the test

```
FetchError: request to http://localhost:6109/list failed, reason: connect ECONNREFUSED ::1:6109
```

Node.js used to favor IPv4 but that changed in v17

> It's #39987 -- Node.js now returns IP addresses in the order they are returned from the name resolver/DNS. There's a --dns-result-order command line option you can set to control the behaviour -- the difference in Node.js 17 is the default changed.

nodejs/node#40537 (comment)

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
  • Loading branch information
rak-phillip committed Nov 1, 2023
1 parent 0673f7c commit 1b569f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion e2e/credentials-server.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ describeWithCreds('Credentials server', () => {
});

test('should require authentication', async() => {
const url = `http://localhost:${ serverState.port }/list`;
const url = `http://127.0.0.1:${ serverState.port }/list`;
const resp = await fetch(url);

expect(resp.ok).toBeFalsy();
Expand Down

0 comments on commit 1b569f8

Please sign in to comment.