Dont fetch robots.txt on non HTTP requests

main
Elbert Alias 7 years ago
parent 727215463c
commit f588270579

@ -117,6 +117,10 @@ class Wappalyzer {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
var parsed = this.parseUrl(url); var parsed = this.parseUrl(url);
if ( parsed.protocol !== 'http:' && parsed.protocol !== 'https:' ) {
reject();
}
this.driver.getRobotsTxt(parsed.host, parsed.protocol === 'https:') this.driver.getRobotsTxt(parsed.host, parsed.protocol === 'https:')
.then(robotsTxt => { .then(robotsTxt => {
robotsTxt.forEach(disallow => parsed.pathname.indexOf(disallow) === 0 && reject()); robotsTxt.forEach(disallow => parsed.pathname.indexOf(disallow) === 0 && reject());

Loading…
Cancel
Save