Merge pull request #1237 from kevNii/master

Use headers instead of whole response (npm driver)
main
Elbert Alias 9 years ago committed by GitHub
commit e6bc651903

@ -29,7 +29,7 @@ exports.detectFromHTML = function(options, data, cb) {
/** /**
* Do a actual request for the body & headers, then * Do a actual request for the body & headers, then
* run through detection * run through detection
**/ **/
exports.detectFromUrl = function(options, cb) { exports.detectFromUrl = function(options, cb) {
// ensure options and url were // ensure options and url were
@ -59,7 +59,7 @@ exports.detectFromUrl = function(options, cb) {
exports.detect(options, data, cb); exports.detect(options, data, cb);
} }
}); });
} }
@ -71,7 +71,7 @@ function getHTMLFromUrl(url, cb) {
var data = { var data = {
html: body, html: body,
url: url, url: url,
headers: response headers: response.headers
}; };
cb(null, data); cb(null, data);
} else { } else {