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();
} else {
// HTTP status 404: NotFound
res.status(404)
.send('Not found - use https instead!');
res.writeHead(404, {
"Content-Type": "text/plain"
});
res.write("404 Not Found - use https instead!\n");
res.end();
};
}).listen(app_cfg.global.http_port);