Add option for custom request headers in NPM

main
Elbert Alias 4 years ago
parent 8be327e141
commit 94c275b195

@ -86,26 +86,6 @@
], ],
"website": "https://www.adplan7.com/" "website": "https://www.adplan7.com/"
}, },
"Afterpay": {
"cats": [
41
],
"cpe": "cpe:/a:afterpay:afterpay",
"icon": "afterpay.png",
"script": [
"portal\\.afterpay\\.com",
"static\\.afterpay\\.com"
],
"website": "https://www.afterpay.com/"
},
"Amex Checkout": {
"cats": [
41
],
"icon": "amex.png",
"script": "aexp-static\\.com",
"website": "https://www.americanexpress.com/us/express-checkout/"
},
"AMP": { "AMP": {
"cats": [ "cats": [
12 12
@ -512,6 +492,18 @@
"script": "shop-static\\.afterbuy\\.de", "script": "shop-static\\.afterbuy\\.de",
"website": "http://www.afterbuy.de" "website": "http://www.afterbuy.de"
}, },
"Afterpay": {
"cats": [
41
],
"cpe": "cpe:/a:afterpay:afterpay",
"icon": "afterpay.png",
"script": [
"portal\\.afterpay\\.com",
"static\\.afterpay\\.com"
],
"website": "https://www.afterpay.com/"
},
"Ahoy": { "Ahoy": {
"cats": [ "cats": [
10 10
@ -794,6 +786,14 @@
"script": "ametys\\.js", "script": "ametys\\.js",
"website": "http://ametys.org" "website": "http://ametys.org"
}, },
"Amex Checkout": {
"cats": [
41
],
"icon": "amex.png",
"script": "aexp-static\\.com",
"website": "https://www.americanexpress.com/us/express-checkout/"
},
"Amiro.CMS": { "Amiro.CMS": {
"cats": [ "cats": [
1 1
@ -1053,8 +1053,8 @@
"<meta[ˆ>]*appleid-signin-client-id", "<meta[ˆ>]*appleid-signin-client-id",
"<a[ˆ>]*appleid\\.apple\\.com/auth/authorize" "<a[ˆ>]*appleid\\.apple\\.com/auth/authorize"
], ],
"script": "appleid.auth.js",
"icon": "Apple.svg", "icon": "Apple.svg",
"script": "appleid.auth.js",
"website": "https://developer.apple.com/sign-in-with-apple/" "website": "https://developer.apple.com/sign-in-with-apple/"
}, },
"Arastta": { "Arastta": {
@ -3764,15 +3764,6 @@
], ],
"website": "https://etherpad.org" "website": "https://etherpad.org"
}, },
"eWAY Payments": {
"cats": [
41
],
"html": "<img [^>]*src=\"[^/]*//[^/]*eway\\.com",
"icon": "eway.png",
"script": "secure\\.ewaypayments\\.com",
"website": "https://www.eway.com.au/"
},
"Exhibit": { "Exhibit": {
"cats": [ "cats": [
25 25
@ -3886,10 +3877,10 @@
"cats": [ "cats": [
69 69
], ],
"icon": "Facebook.svg",
"js": { "js": {
"FB.getLoginStatus":"" "FB.getLoginStatus": ""
}, },
"icon": "Facebook.svg",
"website": "https://developers.facebook.com/docs/facebook-login/" "website": "https://developers.facebook.com/docs/facebook-login/"
}, },
"Facil-iti": { "Facil-iti": {
@ -3965,17 +3956,6 @@
"icon": "fastspring.png", "icon": "fastspring.png",
"website": "https://fastspring.com" "website": "https://fastspring.com"
}, },
"Fat-Free Framework": {
"cats": [
18
],
"headers": {
"X-Powered-By": "^Fat-Free Framework$"
},
"icon": "Fat-Free Framework.png",
"implies": "PHP",
"website": "http://fatfreeframework.com"
},
"Fat Zebra": { "Fat Zebra": {
"cats": [ "cats": [
41 41
@ -3988,6 +3968,17 @@
"script": "paynow\\.pmnts\\.io", "script": "paynow\\.pmnts\\.io",
"website": "https://www.fatzebra.com/" "website": "https://www.fatzebra.com/"
}, },
"Fat-Free Framework": {
"cats": [
18
],
"headers": {
"X-Powered-By": "^Fat-Free Framework$"
},
"icon": "Fat-Free Framework.png",
"implies": "PHP",
"website": "http://fatfreeframework.com"
},
"Fbits": { "Fbits": {
"cats": [ "cats": [
6 6
@ -4848,23 +4839,6 @@
"script": "googleapis\\.com/.+webfont", "script": "googleapis\\.com/.+webfont",
"website": "http://google.com/fonts" "website": "http://google.com/fonts"
}, },
"Google Sign-in": {
"cats": [
69
],
"html": [
"<meta[^>]*google-signin-client_id",
"<meta[^>]*google-signin-scope",
"<iframe[^>]*accounts\\.google\\.com/o/oauth2",
"<a[^>]*accounts\\.google\\.com/o/oauth2"
],
"script": [
"apis\\.google\\.com/js/platform\\.js",
"accounts\\.google\\.com/gsi/client"
],
"icon": "Google.svg",
"website": "https://developers.google.com/identity/sign-in/web"
},
"Google Maps": { "Google Maps": {
"cats": [ "cats": [
35 35
@ -4904,6 +4878,23 @@
"script": "apis\\.google\\.com/js/[a-z]*\\.js", "script": "apis\\.google\\.com/js/[a-z]*\\.js",
"website": "http://plus.google.com" "website": "http://plus.google.com"
}, },
"Google Sign-in": {
"cats": [
69
],
"html": [
"<meta[^>]*google-signin-client_id",
"<meta[^>]*google-signin-scope",
"<iframe[^>]*accounts\\.google\\.com/o/oauth2",
"<a[^>]*accounts\\.google\\.com/o/oauth2"
],
"icon": "Google.svg",
"script": [
"apis\\.google\\.com/js/platform\\.js",
"accounts\\.google\\.com/gsi/client"
],
"website": "https://developers.google.com/identity/sign-in/web"
},
"Google Sites": { "Google Sites": {
"cats": [ "cats": [
1 1
@ -5071,6 +5062,20 @@
"script": "assets\\.growingio\\.com/([\\d.]+)/gio\\.js\\;version:\\1", "script": "assets\\.growingio\\.com/([\\d.]+)/gio\\.js\\;version:\\1",
"website": "https://www.growingio.com/" "website": "https://www.growingio.com/"
}, },
"HCL Digital Experience": {
"cats": [
1
],
"cpe": "cpe:/a:ibm:websphere_portal",
"headers": {
"IBM-Web2-Location": "",
"Itx-Generated-Timestamp": ""
},
"icon": "IBM.svg",
"implies": "Java",
"url": "/wps/",
"website": "https://www.hcltechsw.com/products/dx"
},
"HERE": { "HERE": {
"cats": [ "cats": [
35 35
@ -5428,20 +5433,6 @@
"url": "/wcs/", "url": "/wcs/",
"website": "http://ibm.com/software/genservers/commerceproductline" "website": "http://ibm.com/software/genservers/commerceproductline"
}, },
"HCL Digital Experience": {
"cats": [
1
],
"cpe": "cpe:/a:ibm:websphere_portal",
"headers": {
"IBM-Web2-Location": "",
"Itx-Generated-Timestamp": ""
},
"icon": "IBM.svg",
"implies": "Java",
"url": "/wps/",
"website": "https://www.hcltechsw.com/products/dx"
},
"IIS": { "IIS": {
"cats": [ "cats": [
22 22
@ -7870,6 +7861,17 @@
"script": "mustache(?:\\.min)?\\.js", "script": "mustache(?:\\.min)?\\.js",
"website": "https://mustache.github.io" "website": "https://mustache.github.io"
}, },
"My Food Link": {
"cats": [
6
],
"html": [
"<div class='mfl-made-by-myfoodlink'>",
"<a href=\"https://www.myfoodlink.com.au"
],
"icon": "myfoodlink.png",
"website": "https://www.myfoodlink.com.au/"
},
"MyBB": { "MyBB": {
"cats": [ "cats": [
2 2
@ -7904,17 +7906,6 @@
"icon": "mycashflow.png", "icon": "mycashflow.png",
"website": "https://www.mycashflow.fi/" "website": "https://www.mycashflow.fi/"
}, },
"My Food Link": {
"cats": [
6
],
"html": [
"<div class='mfl-made-by-myfoodlink'>",
"<a href=\"https://www.myfoodlink.com.au"
],
"icon": "myfoodlink.png",
"website": "https://www.myfoodlink.com.au/"
},
"MySQL": { "MySQL": {
"cats": [ "cats": [
34 34
@ -9059,6 +9050,14 @@
"implies": "PHP", "implies": "PHP",
"website": "http://pimcore.org" "website": "http://pimcore.org"
}, },
"Pin Payments": {
"cats": [
41
],
"icon": "pinpayments.png",
"script": "api\\.pinpayments\\.com",
"website": "https://www.pinpayments.com/"
},
"Pingoteam": { "Pingoteam": {
"cats": [ "cats": [
1 1
@ -9070,14 +9069,6 @@
}, },
"website": "https://www.pingoteam.ir/" "website": "https://www.pingoteam.ir/"
}, },
"Pin Payments": {
"cats": [
41
],
"icon": "pinpayments.png",
"script": "api\\.pinpayments\\.com",
"website": "https://www.pinpayments.com/"
},
"Pinterest": { "Pinterest": {
"cats": [ "cats": [
5 5
@ -10134,8 +10125,8 @@
"cats": [ "cats": [
69 69
], ],
"script": "\\.gigya\\.com/JS/gigya\\.js",
"icon": "SAP.png", "icon": "SAP.png",
"script": "\\.gigya\\.com/JS/gigya\\.js",
"website": "https://www.sap.com/uk/acquired-brands/what-is-gigya.html" "website": "https://www.sap.com/uk/acquired-brands/what-is-gigya.html"
}, },
"SDL Tridion": { "SDL Tridion": {
@ -10693,8 +10684,8 @@
"js": { "js": {
"Shopify": "\\;confidence:25" "Shopify": "\\;confidence:25"
}, },
"url": "^https?//.+\\.myshopify\\.com",
"script": "sdks\\.shopifycdn\\.com", "script": "sdks\\.shopifycdn\\.com",
"url": "^https?//.+\\.myshopify\\.com",
"website": "http://shopify.com" "website": "http://shopify.com"
}, },
"Shopline": { "Shopline": {
@ -11190,14 +11181,6 @@
"implies": "PHP", "implies": "PHP",
"website": "http://www.spin.cw" "website": "http://www.spin.cw"
}, },
"Splitbee": {
"cats": [
10
],
"icon": "splitbee.svg",
"script": "^https:\\/\\/cdn\\.splitbee\\.io\\/sb\\.js",
"website": "https://splitbee.io"
},
"SplitIt": { "SplitIt": {
"cats": [ "cats": [
41 41
@ -11206,6 +11189,14 @@
"script": "checkout\\.production\\.splitit\\.com", "script": "checkout\\.production\\.splitit\\.com",
"website": "https://www.splitit.com/" "website": "https://www.splitit.com/"
}, },
"Splitbee": {
"cats": [
10
],
"icon": "splitbee.svg",
"script": "^https:\\/\\/cdn\\.splitbee\\.io\\/sb\\.js",
"website": "https://splitbee.io"
},
"Splunk": { "Splunk": {
"cats": [ "cats": [
19 19
@ -11663,6 +11654,14 @@
"implies": "Tessitura", "implies": "Tessitura",
"website": "https://www.tessituranetwork.com" "website": "https://www.tessituranetwork.com"
}, },
"TNS Payments": {
"cats": [
41
],
"icon": "tnsi.png",
"script": "secure\\.ap\\.tnspayments\\.com",
"website": "https://tnsi.com/products/payments/"
},
"TWiki": { "TWiki": {
"cats": [ "cats": [
8 8
@ -12022,14 +12021,6 @@
}, },
"website": "http://titan360.com" "website": "http://titan360.com"
}, },
"TNS Payments": {
"cats": [
41
],
"icon": "tnsi.png",
"script": "secure\\.ap\\.tnspayments\\.com",
"website": "https://tnsi.com/products/payments/"
},
"TomatoCart": { "TomatoCart": {
"cats": [ "cats": [
6 6
@ -12441,14 +12432,6 @@
"script": "/js/ushahidi\\.js$", "script": "/js/ushahidi\\.js$",
"website": "http://www.ushahidi.com" "website": "http://www.ushahidi.com"
}, },
"Visa Checkout": {
"cats": [
41
],
"icon": "visa.png",
"script": "secure\\.checkout\\.visa\\.com",
"website": "https://checkout.visa.com"
},
"VIVVO": { "VIVVO": {
"cats": [ "cats": [
1 1
@ -12672,6 +12655,14 @@
"icon": "Visa.svg", "icon": "Visa.svg",
"website": "https://www.visa.com" "website": "https://www.visa.com"
}, },
"Visa Checkout": {
"cats": [
41
],
"icon": "visa.png",
"script": "secure\\.checkout\\.visa\\.com",
"website": "https://checkout.visa.com"
},
"Visual Website Optimizer": { "Visual Website Optimizer": {
"cats": [ "cats": [
10 10
@ -13822,6 +13813,18 @@
}, },
"website": "http://django-blog-zinnia.com" "website": "http://django-blog-zinnia.com"
}, },
"Zip Pay / Zip Money": {
"cats": [
41
],
"html": "<img [^>]*src=\"[^/]*//[^/]*eway\\.com",
"icon": "zip_pay.png",
"script": [
"static\\.zipmoney\\.com\\.au",
"zip\\.co"
],
"website": "https://www.zip.co/"
},
"Zipkin": { "Zipkin": {
"cats": [ "cats": [
10 10
@ -14037,6 +14040,15 @@
}, },
"website": "http://esyndicat.com" "website": "http://esyndicat.com"
}, },
"eWAY Payments": {
"cats": [
41
],
"html": "<img [^>]*src=\"[^/]*//[^/]*eway\\.com",
"icon": "eway.png",
"script": "secure\\.ewaypayments\\.com",
"website": "https://www.eway.com.au/"
},
"eZ Platform": { "eZ Platform": {
"cats": [ "cats": [
1, 1,
@ -15190,18 +15202,6 @@
"generator": "xt:Commerce" "generator": "xt:Commerce"
}, },
"website": "https://www.xt-commerce.com" "website": "https://www.xt-commerce.com"
},
"Zip Pay / Zip Money": {
"cats": [
41
],
"html": "<img [^>]*src=\"[^/]*//[^/]*eway\\.com",
"icon": "zip_pay.png",
"script": [
"static\\.zipmoney\\.com\\.au",
"zip\\.co"
],
"website": "https://www.zip.co/"
} }
}, },
"categories": { "categories": {

@ -54,6 +54,7 @@ const url = 'https://www.wappalyzer.com';
const options = { const options = {
debug: false, debug: false,
delay: 500, delay: 500,
headers: {},
maxDepth: 3, maxDepth: 3,
maxUrls: 10, maxUrls: 10,
maxWait: 5000, maxWait: 5000,
@ -69,7 +70,10 @@ const options = {
try { try {
await wappalyzer.init() await wappalyzer.init()
const site = await wappalyzer.open(url) // Optionally set additional request headers
const headers = {}
const site = await wappalyzer.open(url, headers)
// Optionally capture and output errors // Optionally capture and output errors
site.on('error', console.error) site.on('error', console.error)

@ -130,8 +130,8 @@ class Driver {
} }
} }
open(url) { open(url, headers = {}) {
return new Site(url.split('#')[0], this) return new Site(url.split('#')[0], headers, this)
} }
log(message, source = 'driver') { log(message, source = 'driver') {
@ -143,9 +143,14 @@ class Driver {
} }
class Site { class Site {
constructor(url, driver) { constructor(url, headers = {}, driver) {
;({ options: this.options, browser: this.browser } = driver) ;({ options: this.options, browser: this.browser } = driver)
this.options.headers = {
...this.options.headers,
...headers
}
this.driver = driver this.driver = driver
try { try {
@ -232,7 +237,12 @@ class Site {
) { ) {
request.abort('blockedbyclient') request.abort('blockedbyclient')
} else { } else {
request.continue() const headers = {
...request.headers(),
...this.options.headers
}
request.continue({ headers })
} }
} catch (error) { } catch (error) {
this.error(error) this.error(error)

Loading…
Cancel
Save