Skip to content

Commit

Permalink
fix: use 127.0.0.1 instead of localhost for healthcheck for compatibi…
Browse files Browse the repository at this point in the history
…lity with node 18.

See node-fetch/node-fetch#1624.
  • Loading branch information
outofcoffee committed Jan 26, 2024
1 parent 5b25d9c commit df60bc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/configured-mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class ConfiguredMock {
throw new Error(`Failed to start mock engine on port ${this.port}. Exit code: ${proc.exitCode}${advice}`);
}
try {
const response = await httpGet(`http://localhost:${this.port}/system/status`);
const response = await httpGet(`http://127.0.0.1:${this.port}/system/status`);
if (response.status === 200) {
nodeConsole.debug('Mock server is up!');
break
Expand Down Expand Up @@ -167,7 +167,7 @@ export class ConfiguredMock {
if (!this.port) {
throw new Error('Cannot get base URL before starting mock unless port explicitly set');
}
return `http://localhost:${this.port}`;
return `http://127.0.0.1:${this.port}`;
}
}

Expand Down

0 comments on commit df60bc5

Please sign in to comment.