0
Fork 0
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:
Alex Kocharin 2014-07-21 19:06:44 +04:00
parent ff8a5e99ec
commit 41d4997ea7

View file

@ -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
}