Ensure regexes are applied to multi-value headers.

main
Joao Poupino 8 years ago
parent ce37d5785e
commit e5709c1d58

@ -351,9 +351,17 @@ var wappalyzer = (function() {
for ( header in w.apps[app].headers ) { for ( header in w.apps[app].headers ) {
parse(w.apps[app][type][header]).forEach(function(pattern) { parse(w.apps[app][type][header]).forEach(function(pattern) {
if ( data[type][header.toLowerCase()] instanceof Array ) {
data[type][header.toLowerCase()].forEach(function(el) {
if ( typeof el === 'string' && pattern.regex.test(el) ) {
apps[app].setDetected(pattern, type, data[type][header.toLowerCase()], header);
}
});
} else {
if ( typeof data[type][header.toLowerCase()] === 'string' && pattern.regex.test(data[type][header.toLowerCase()]) ) { if ( typeof data[type][header.toLowerCase()] === 'string' && pattern.regex.test(data[type][header.toLowerCase()]) ) {
apps[app].setDetected(pattern, type, data[type][header.toLowerCase()], header); apps[app].setDetected(pattern, type, data[type][header.toLowerCase()], header);
} }
}
profiler.checkPoint(app, type, pattern.regex); profiler.checkPoint(app, type, pattern.regex);
}); });

Loading…
Cancel
Save