Merge pull request #1293 from poupas/master

Ensure regexes are applied to multi-value headers.
main
Elbert Alias 8 years ago committed by GitHub
commit a1a7aae6d5

@ -351,8 +351,16 @@ 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 ( typeof data[type][header.toLowerCase()] === 'string' && pattern.regex.test(data[type][header.toLowerCase()]) ) { if ( data[type][header.toLowerCase()] instanceof Array ) {
apps[app].setDetected(pattern, type, data[type][header.toLowerCase()], header); 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()]) ) {
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