Skip to content

Commit

Permalink
fix(src): ensure ephemeral test servers only listen on localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
Xunnamius committed Jan 18, 2024
1 parent f4ee989 commit d7774b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ export async function testApiHandler<NextResponseJsonType = any>({
server = pagesHandler ? createPagesRouterServer() : createAppRouterServer();

const port = await new Promise<number>((resolve, reject) => {
server?.listen(() => {
server?.listen(0, 'localhost', undefined, () => {
const addr = server?.address();

if (!addr || typeof addr === 'string') {
Expand Down

0 comments on commit d7774b3

Please sign in to comment.