From 5a45d1d14694deca4c4f505bd207f6eb20e65865 Mon Sep 17 00:00:00 2001 From: Holly Date: Tue, 22 Feb 2022 09:51:01 +0000 Subject: [PATCH] remove more headers that are not needed --- server/loginHandler.js | 5 ++++- server/loginHelper.js | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/server/loginHandler.js b/server/loginHandler.js index f3dcd15..3204725 100644 --- a/server/loginHandler.js +++ b/server/loginHandler.js @@ -22,6 +22,8 @@ module.exports = async function(req, res, loginInfo) { // Check login const loginCheck = await loginHelper.checkLogin(loginInfo); if (loginCheck != null) { + res.removeHeader('X-Powered-By'); + res.removeHeader('Date'); res.writeHead(200, loginCheck[1]); return res.end(loginCheck[0]); } @@ -143,13 +145,14 @@ module.exports = async function(req, res, loginInfo) { osuPacketWriter.Announce(`Welcome back ${loginInfo.username}!`); + res.removeHeader('X-Powered-By'); + res.removeHeader('Date'); // Complete login res.writeHead(200, { "cho-token": NewUser.uuid, "cho-protocol": global.protocolVersion, "Connection": "keep-alive", "Keep-Alive": "timeout=5, max=100", - "Content-Type": "text/html; charset=UTF-8" }); res.end(osuPacketWriter.toBuffer, () => { consoleHelper.printBancho(`User login finished, took ${Date.now() - loginStartTime}ms. [User: ${loginInfo.username}]`); diff --git a/server/loginHelper.js b/server/loginHelper.js index 59a3133..a560314 100644 --- a/server/loginHelper.js +++ b/server/loginHelper.js @@ -34,11 +34,9 @@ function incorrectLoginResponse() { return [ osuPacketWriter.toBuffer, { - 'cho-token': 'No', 'cho-protocol': global.protocolVersion, 'Connection': 'keep-alive', 'Keep-Alive': 'timeout=5, max=100', - 'Content-Type': 'text/html; charset=UTF-8' } ]; } @@ -50,11 +48,9 @@ function requiredPWChangeResponse() { return [ osuPacketWriter.toBuffer, { - 'cho-token': 'No', 'cho-protocol': global.protocolVersion, 'Connection': 'keep-alive', 'Keep-Alive': 'timeout=5, max=100', - 'Content-Type': 'text/html; charset=UTF-8' } ]; } \ No newline at end of file