set content-type headers for the 404 page

This commit is contained in:
ansuz 2018-04-12 17:24:51 +02:00
parent d0eeefc04c
commit bc35c3349f
1 changed files with 2 additions and 1 deletions

View File

@ -188,6 +188,7 @@ var custom_four04_path = Path.resolve(__dirname + '/customize/404.html');
var send404 = function (res, path) {
if (!path && path !== four04_path) { path = four04_path; }
Fs.exists(path, function (exists) {
res.setHeader('Content-Type', 'text/html; charset=utf-8');
if (exists) { return Fs.createReadStream(path).pipe(res); }
send404(res);
});
@ -250,4 +251,4 @@ var nt = nThen(function (w) {
if (config.debugReplName) {
require('replify')({ name: config.debugReplName, app: debuggableStore });
}
}