Improved checking for content type to allow for charset, etc.
This commit is contained in:
parent
2033716848
commit
3695778550
|
@ -218,7 +218,7 @@ function run(filename) {
|
||||||
return;
|
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']);
|
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'] });
|
reject({ code: 2, error: "Fetching failed with incorrect content type " + response.headers['content-type'] });
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue