Fix issue #496: Cannot set headers after they are sent to the client on Node.js>10.1.0

This commit is contained in:
DanielDiBe 2018-07-27 11:52:29 +02:00 committed by Daniel Díaz Benito
parent d8917f33fd
commit 4b2e09dcfd

View File

@ -138,7 +138,8 @@ function plugin(options, imports, register) {
req.on("close", function() {
done = true;
cancel();
res.json({}, 0, 500);
if(!res.headersSent)
res.json({}, 0, 500);
});
}
]);