From b38e1cea5ff4b734f6ac5842812486b6bfec8820 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Sun, 12 Nov 2023 18:41:06 +0100 Subject: [PATCH] Fixed crashes due of destroyed HTTP/2 stream (Node.JS bug: https://github.com/nodejs/node/issues/24470) --- config.json | 4 ++-- svr.js | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config.json b/config.json index d5a9e44..20da88f 100644 --- a/config.json +++ b/config.json @@ -3,7 +3,7 @@ "port": 80, "pubport": 80, "page404": "404.html", - "timestamp": 1699810328987, + "timestamp": 1699810857032, "blacklist": [], "nonStandardCodes": [], "enableCompression": true, @@ -102,4 +102,4 @@ "errorPages": [], "useWebRootServerSideScript": true, "exposeModsInErrorPages": true -} +} \ No newline at end of file diff --git a/svr.js b/svr.js index f7cbabf..2e8fcea 100644 --- a/svr.js +++ b/svr.js @@ -2798,7 +2798,11 @@ if (!cluster.isPrimary) { delete table["connection"]; delete table["keep-alive"]; delete table["upgrade"]; - return res.writeHeadNodeApi(a, table); + if(res.stream && res.stream.destroyed) { + return false; + } else { + return res.writeHeadNodeApi(a, table); + } }; res.setHeader = function (a, b) {