Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/spec-utils/httpRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export async function request(options: { type: string; url: string; headers: Rec
headers: options.headers,
agent: new ProxyAgent(),
secureContext,
timeout: 3000
};

const plainHTTP = parsed.protocol === 'http:' || parsed.hostname === 'localhost';
Expand All @@ -41,6 +42,9 @@ export async function request(options: { type: string; url: string; headers: Rec
res.on('end', () => resolve(Buffer.concat(chunks)));
}
});
req.on('timeout', () => {
req.destroy();
});
req.on('error', reject);
if (options.data) {
req.write(options.data);
Expand Down