Improved checking for content type to allow for charset, etc.

This commit is contained in:
Mike Flynn 2016-06-28 14:34:48 -07:00
parent 2033716848
commit 3695778550
1 changed files with 1 additions and 1 deletions

View File

@ -218,7 +218,7 @@ function run(filename) {
return;
}
if (response.headers['content-type'] !== 'text/plain') {
if (response.headers['content-type'].indexOf('text/plain') !== 0) {
console.error("Fetching failed with incorrect content type %s", response.headers['content-type']);
reject({ code: 2, error: "Fetching failed with incorrect content type " + response.headers['content-type'] });
return;