send the test files with the correct content-type header

pull/4600/head
webzwo0i 2020-12-27 23:32:09 +01:00 committed by John McLear
parent 951c93fa6d
commit ca405c1685
1 changed files with 3 additions and 1 deletions

View File

@ -17,7 +17,7 @@ exports.expressCreateServer = function (hook_name, args, cb) {
files = files.filter((f) => f.endsWith('.js'));
console.debug('Sent browser the following test specs:', files);
res.setHeader('content-type', 'text/javascript');
res.setHeader('content-type', 'application/javascript');
res.end(`var specs_list = ${JSON.stringify(files)};\n`);
});
@ -49,6 +49,8 @@ exports.expressCreateServer = function (hook_name, args, cb) {
content = `describe(${JSON.stringify(specFileName)}, function(){ ${content} });`;
if(!specFilePath.endsWith('index.html')) res.setHeader('content-type', 'application/javascript');
res.send(content);
});
});