Merge pull request #512 from DanielDiBe/headers-sent-fix

Fix issue #496: Cannot set headers after they are sent to the client
pull/518/head
Harutyun Amirjanyan 2018-08-09 15:01:59 +04:00 zatwierdzone przez GitHub
commit cc906be318
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -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);
});
}
]);