From acf767c71e7c6dd9b335f28930be71ea7ad235cb Mon Sep 17 00:00:00 2001 From: Holly Date: Tue, 22 Feb 2022 09:01:19 +0000 Subject: [PATCH] Minimise the number of headers the server is sending --- server/serverHandler.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/serverHandler.js b/server/serverHandler.js index 3531474..660fb06 100644 --- a/server/serverHandler.js +++ b/server/serverHandler.js @@ -357,13 +357,16 @@ module.exports = async function(req, res) { } catch (e) { console.error(e); } finally { - // Send the prepared packet to the client + // Only send the headers that we absolutely have to + res.removeHeader('X-Powered-By'); + res.removeHeader('Date'); res.writeHead(200, { "cho-protocol": global.protocolVersion, + // Nice to have "Connection": "keep-alive", "Keep-Alive": "timeout=5, max=100", - "Content-Type": "text/html; charset=UTF-8" }); + // Send the prepared packet(s) to the client res.end(responseData); } }