Skip to content

Commit

Permalink
fix: avoid headers already sent error
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Nov 1, 2018
1 parent db3b1e4 commit f1b3459
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions lib/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ function proxy (state, { target }) {
onError (error, request, response) {
/* istanbul ignore if */
if (error.message.indexOf('Nock: No match for request') !== 0) {
if (!response.headerSent) {
response.writeHead(500, {
'Content-Type': 'application/json; charset=utf-8'
})
}

return response.end(JSON.stringify({
error: error.message
}))
Expand Down

0 comments on commit f1b3459

Please sign in to comment.