From 7dd5e4f16734dae80756c170c2680c98f6679368 Mon Sep 17 00:00:00 2001 From: yuto0214w Date: Sun, 7 Nov 2021 18:41:26 +0900 Subject: Update node_server_without_framework --- files/ja/learn/server-side/node_server_without_framework/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'files/ja/learn') diff --git a/files/ja/learn/server-side/node_server_without_framework/index.html b/files/ja/learn/server-side/node_server_without_framework/index.html index a7ca7493b5..a59228be80 100644 --- a/files/ja/learn/server-side/node_server_without_framework/index.html +++ b/files/ja/learn/server-side/node_server_without_framework/index.html @@ -65,7 +65,7 @@ http.createServer(function (request, response) { if (error) { if(error.code == 'ENOENT') { fs.readFile('./404.html', function(error, content) { - response.writeHead(200, { 'Content-Type': contentType }); + response.writeHead(404, { 'Content-Type': 'text/html' }); response.end(content, 'utf-8'); }); } @@ -143,7 +143,7 @@ var contentType = mimeTypes[extname] || 'application/octet-stream';
if(error.code == 'ENOENT') {
     fs.readFile('./404.html', function(error, content) {
-        response.writeHead(200, { 'Content-Type': contentType });
+        response.writeHead(404, { 'Content-Type': 'text/html' });
         response.end(content, 'utf-8');
     });
 }
-- 
cgit v1.2.3-54-g00ecf