From 0b9ee5fd6fa30fb215b799d7b239cea631c069ce Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Mon, 3 Dec 2018 10:53:24 +0100 Subject: [PATCH] http: fix backport of Slowris headers The backport of https://github.com/nodejs/node/commit/618eebdd17 was not complete, and the starting time to parse the headers was not reset. Fixes: https://github.com/nodejs/node/issues/24760 --- lib/_http_server.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/_http_server.js b/lib/_http_server.js index 54e080717a7567..a224cc795fc13a 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -481,6 +481,9 @@ function connectionListener(socket) { function parserOnIncoming(req, shouldKeepAlive) { incoming.push(req); + // Set to zero to communicate that we have finished parsing. + socket.parser.parsingHeadersStart = 0; + // If the writable end isn't consuming, then stop reading // so that we don't become overwhelmed by a flood of // pipelined requests that may never be resolved.