Sende 404 wenn Host im Reqeust unbekannt

This commit is contained in:
Richter 2019-05-13 10:39:55 +02:00
parent bc1770a768
commit b6e1f514be

View File

@ -53,8 +53,11 @@ http.createServer(function(req, res) {
res.end(); res.end();
} else { } else {
// HTTP status 404: NotFound // HTTP status 404: NotFound
res.status(404) res.writeHead(404, {
.send('Not found - use https instead!'); "Content-Type": "text/plain"
});
res.write("404 Not Found - use https instead!\n");
res.end();
}; };
}).listen(app_cfg.global.http_port); }).listen(app_cfg.global.http_port);