From b6e1f514bea5547e9971e34db3ddcd9249c32681 Mon Sep 17 00:00:00 2001 From: Richter Date: Mon, 13 May 2019 10:39:55 +0200 Subject: [PATCH] Sende 404 wenn Host im Reqeust unbekannt --- server.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index b599cec..ed59249 100644 --- a/server.js +++ b/server.js @@ -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);