Skip to content

Commit

Permalink
Disable keep-alive by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Rowno committed Dec 1, 2023
1 parent 6972fa0 commit 5ee59ca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ class HttpStub {
await sleep(stub.delay)
}

// Disable keep-alive by default to prevent server shutdown from hanging
res.setHeader('Connection', 'close')

if (stub.headers) {
for (const name of Object.keys(stub.headers)) {
const value = stub.headers[name]
Expand Down

0 comments on commit 5ee59ca

Please sign in to comment.