diff options
Diffstat (limited to 'files/es')
-rw-r--r-- | files/es/learn/server-side/node_server_without_framework/index.html | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/files/es/learn/server-side/node_server_without_framework/index.html b/files/es/learn/server-side/node_server_without_framework/index.html index 11826d3e73..c103f58774 100644 --- a/files/es/learn/server-side/node_server_without_framework/index.html +++ b/files/es/learn/server-side/node_server_without_framework/index.html @@ -33,7 +33,6 @@ http.createServer(function (request, response) { } var extname = String(path.extname(filePath)).toLowerCase(); - var contentType = 'text/html'; var mimeTypes = { '.html': 'text/html', '.js': 'text/javascript', @@ -51,13 +50,13 @@ http.createServer(function (request, response) { '.svg': 'application/image/svg+xml' }; - contentType = mimeTypes[extname] || 'application/octet-stream'; + var contentType = mimeTypes[extname] || 'application/octet-stream'; fs.readFile(filePath, function(error, content) { 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'); }); } |