From 5f7f198a68ff497e7a887b9eebbfe3637066d016 Mon Sep 17 00:00:00 2001 From: Vu Tran Date: Sun, 13 Oct 2019 23:45:45 +0700 Subject: [PATCH] Update crawler.js --- lib/crawler.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/crawler.js b/lib/crawler.js index d5b37bb..48c0ab5 100644 --- a/lib/crawler.js +++ b/lib/crawler.js @@ -397,8 +397,11 @@ Crawler.prototype._onContent = function _onContent (error, options, response) { var injectableTypes = ['html','xhtml','text/xml', 'application/xml', '+xml']; if (!options.html && !typeis(contentType(response), injectableTypes)){ - log('warn','response body is not HTML, skip injecting. Set jQuery to false to suppress this message'); - return options.callback(null,response,options.release); + // in case gzip, content-type is undefined, we can test first 100 bytes for tag html + if(!/\