Disable robots.txt fetching when tracking is disabled

main
Elbert Alias 7 years ago
parent 123058f69b
commit f4850308e4

@ -266,6 +266,12 @@ wappalyzer.driver.displayApps = (detected, context) => {
*/
wappalyzer.driver.getRobotsTxt = (host, secure = false) => {
return new Promise((resolve, reject) => {
getOption('tracking', true)
.then(tracking => {
if ( !tracking ) {
return resolve([]);
}
getOption('robotsTxtCache')
.then(robotsTxtCache => {
robotsTxtCache = robotsTxtCache || {};
@ -273,7 +279,7 @@ wappalyzer.driver.getRobotsTxt = (host, secure = false) => {
if ( host in robotsTxtCache ) {
resolve(robotsTxtCache[host]);
} else {
var url = 'http' + ( secure ? 's' : '' ) + '://' + host + '/robots.txt';
const url = 'http' + ( secure ? 's' : '' ) + '://' + host + '/robots.txt';
fetch('http' + ( secure ? 's' : '' ) + '://' + host + '/robots.txt')
.then(response => {
@ -293,13 +299,12 @@ wappalyzer.driver.getRobotsTxt = (host, secure = false) => {
setOption('robotsTxtCache', robotsTxtCache);
resolve(robotsTxtCache[host]);
var hostname = host.replace(/:[0-9]+$/, '')
})
.catch(reject);
}
});
});
});
};
/**

Loading…
Cancel
Save