Add a Server: header.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4568 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-10-22 12:44:12 +00:00
parent 7c721fc6eb
commit 14a2207064

View File

@ -120,6 +120,7 @@ function Response(request, client) {
let requestVersion = request.version.split("/")[1].split("."); let requestVersion = request.version.split("/")[1].split(".");
let responseVersion = (requestVersion[0] >= 1 && requestVersion[0] >= 1) ? "1.1" : "1.0"; let responseVersion = (requestVersion[0] >= 1 && requestVersion[0] >= 1) ? "1.1" : "1.0";
let headerString = "HTTP/" + responseVersion + " " + status + " " + reason + "\r\n"; let headerString = "HTTP/" + responseVersion + " " + status + " " + reason + "\r\n";
headers['Server'] = `Tilde Friends/${version().number}`;
for (let i in headers) { for (let i in headers) {
headerString += i + ": " + headers[i] + "\r\n"; headerString += i + ": " + headers[i] + "\r\n";
lowerHeaders[i.toLowerCase()] = headers[i]; lowerHeaders[i.toLowerCase()] = headers[i];