Added check for the correct content type in addition to the response status code.

This commit is contained in:
Mike Flynn 2016-06-18 16:41:26 -07:00
parent a3bd1607ec
commit 3ef528ae1b
1 changed files with 7 additions and 1 deletions

View File

@ -217,6 +217,12 @@ function run(filename) {
return; return;
} }
if (response.headers['content-type'] !== 'text/plain') {
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;
}
var lines = body.split("\n") var lines = body.split("\n")
, certs = parseCertData(lines) , certs = parseCertData(lines)
, pemsFile = path.join(outputPemsDir, 'mozilla-certdata.txt') , pemsFile = path.join(outputPemsDir, 'mozilla-certdata.txt')