Skip to content
This repository was archived by the owner on Jan 6, 2022. It is now read-only.

Commit 3fcdbc3

Browse files
edsilvJoe Hand
authored andcommitted
only set header if not already sent (#46)
1 parent 71796d9 commit 3fcdbc3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ function waitFor (archive, until, cb) { // this feels a bit hacky, TODO: make le
146146

147147
function onerror (res, status, err) {
148148
res.statusCode = status
149-
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
149+
if (!res.headersSent) {
150+
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
151+
}
150152
res.end(err.stack)
151153
}
152154

0 commit comments

Comments
 (0)