From 1612c54d80c2251eb9173964e22d24ec332d579e Mon Sep 17 00:00:00 2001 From: Elbert Alias Date: Sun, 1 Oct 2017 12:26:18 +1100 Subject: [PATCH] Fix NPM driver --- src/drivers/npm/driver.js | 7 ++++++- src/wappalyzer.js | 8 +++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/drivers/npm/driver.js b/src/drivers/npm/driver.js index ef7569b17..87f91e963 100644 --- a/src/drivers/npm/driver.js +++ b/src/drivers/npm/driver.js @@ -61,7 +61,12 @@ const driver = { browser.visit(url, error => { wappalyzer.driver.document = browser.document; - const headers = browser.resources['0'].response.headers; + const headers = {}; + + browser.resources['0'].response.headers._headers.forEach(header => { + headers[header[0]] = header[1]; + }); + const vars = Object.getOwnPropertyNames(browser.window); const html = browser.html(); diff --git a/src/wappalyzer.js b/src/wappalyzer.js index 1374dbfbe..6fed51ec9 100644 --- a/src/wappalyzer.js +++ b/src/wappalyzer.js @@ -296,10 +296,6 @@ class Wappalyzer { * Cache detected applications */ cacheDetectedApps(apps, url) { - if ( !( this.driver.ping instanceof Function ) ) { - return; - } - Object.keys(apps).forEach(appName => { var app = apps[appName]; @@ -311,7 +307,9 @@ class Wappalyzer { }); }) - this.ping(); + if ( this.driver.ping instanceof Function ) { + this.ping(); + } } /**