mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-27 22:59:51 -05:00
only close socket if it exists, fix #89
This commit is contained in:
parent
ff8a5e99ec
commit
41d4997ea7
1 changed files with 2 additions and 1 deletions
|
@ -157,7 +157,8 @@ module.exports.log_and_etagify = function(req, res, next) {
|
|||
// as an error handler, we can't report error properly,
|
||||
// and should just close socket
|
||||
if (err.message.match(/set headers after they are sent/)) {
|
||||
return res.socket.destroy()
|
||||
if (res.socket != null) res.socket.destroy()
|
||||
return
|
||||
} else {
|
||||
throw err
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue