Minimise the number of headers the server is sending
This commit is contained in:
parent
919e0b6701
commit
acf767c71e
1 changed files with 5 additions and 2 deletions
|
@ -357,13 +357,16 @@ module.exports = async function(req, res) {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
} finally {
|
} 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, {
|
res.writeHead(200, {
|
||||||
"cho-protocol": global.protocolVersion,
|
"cho-protocol": global.protocolVersion,
|
||||||
|
// Nice to have
|
||||||
"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"
|
|
||||||
});
|
});
|
||||||
|
// Send the prepared packet(s) to the client
|
||||||
res.end(responseData);
|
res.end(responseData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue