remove more headers that are not needed

This commit is contained in:
Holly Stubbs 2022-02-22 09:51:01 +00:00
parent e5495628f3
commit 5a45d1d146
Signed by: tgpholly
GPG key ID: B8583C4B7D18119E
2 changed files with 4 additions and 5 deletions

View file

@ -22,6 +22,8 @@ module.exports = async function(req, res, loginInfo) {
// Check login // Check login
const loginCheck = await loginHelper.checkLogin(loginInfo); const loginCheck = await loginHelper.checkLogin(loginInfo);
if (loginCheck != null) { if (loginCheck != null) {
res.removeHeader('X-Powered-By');
res.removeHeader('Date');
res.writeHead(200, loginCheck[1]); res.writeHead(200, loginCheck[1]);
return res.end(loginCheck[0]); return res.end(loginCheck[0]);
} }
@ -143,13 +145,14 @@ module.exports = async function(req, res, loginInfo) {
osuPacketWriter.Announce(`Welcome back ${loginInfo.username}!`); osuPacketWriter.Announce(`Welcome back ${loginInfo.username}!`);
res.removeHeader('X-Powered-By');
res.removeHeader('Date');
// Complete login // Complete login
res.writeHead(200, { res.writeHead(200, {
"cho-token": NewUser.uuid, "cho-token": NewUser.uuid,
"cho-protocol": global.protocolVersion, "cho-protocol": global.protocolVersion,
"Connection": "keep-alive", "Connection": "keep-alive",
"Keep-Alive": "timeout=5, max=100", "Keep-Alive": "timeout=5, max=100",
"Content-Type": "text/html; charset=UTF-8"
}); });
res.end(osuPacketWriter.toBuffer, () => { res.end(osuPacketWriter.toBuffer, () => {
consoleHelper.printBancho(`User login finished, took ${Date.now() - loginStartTime}ms. [User: ${loginInfo.username}]`); consoleHelper.printBancho(`User login finished, took ${Date.now() - loginStartTime}ms. [User: ${loginInfo.username}]`);

View file

@ -34,11 +34,9 @@ function incorrectLoginResponse() {
return [ return [
osuPacketWriter.toBuffer, osuPacketWriter.toBuffer,
{ {
'cho-token': 'No',
'cho-protocol': global.protocolVersion, 'cho-protocol': global.protocolVersion,
'Connection': 'keep-alive', 'Connection': 'keep-alive',
'Keep-Alive': 'timeout=5, max=100', 'Keep-Alive': 'timeout=5, max=100',
'Content-Type': 'text/html; charset=UTF-8'
} }
]; ];
} }
@ -50,11 +48,9 @@ function requiredPWChangeResponse() {
return [ return [
osuPacketWriter.toBuffer, osuPacketWriter.toBuffer,
{ {
'cho-token': 'No',
'cho-protocol': global.protocolVersion, 'cho-protocol': global.protocolVersion,
'Connection': 'keep-alive', 'Connection': 'keep-alive',
'Keep-Alive': 'timeout=5, max=100', 'Keep-Alive': 'timeout=5, max=100',
'Content-Type': 'text/html; charset=UTF-8'
} }
]; ];
} }