Fix YLT freezing the queue when an incorrect gzip header is sent on a file

This commit is contained in:
Gaël Métais
2015-07-22 15:48:45 +02:00
parent 7779efedf1
commit e342a88f7d
3 changed files with 11 additions and 2 deletions
+7
View File
@@ -46,6 +46,7 @@ var WeightChecker = function() {
.then(gzipCompressor.compressFile)
.then(function(newEntry) {
debug('File %s - Redownloaded, optimized, minified, compressed: done', entry.url);
callback(null, newEntry);
})
@@ -439,7 +440,9 @@ var WeightChecker = function() {
isCompressed = true;
tally();
}).on('error', function(err) {
debug('Error while decoding %s', requestOptions.url);
debug(err);
callback(err);
});
res.on('data', function (data) {
@@ -459,7 +462,9 @@ var WeightChecker = function() {
isCompressed = true;
tally();
}).on('error', function(err) {
debug('Error while decoding %s', requestOptions.url);
debug(err);
callback(err);
});
res.on('data', function (data) {
@@ -489,6 +494,8 @@ var WeightChecker = function() {
})
.on('error', function(err) {
debug('Error while downloading %s', requestOptions.url);
debug(err);
callback(err);
});
}