[bug fix] Allow analyzeCookies to check for cookies with Uppercase names (#2467)

* [Bug Fix] Allow analyzeCookies to check for uppercase cookie names

* Added Uppercase cookie to test case

* Added Uppercase cookie to test case
main
Brendan H 6 years ago committed by Elbert Alias
parent 28b62a8a7e
commit 35f9cd130a

@ -629,10 +629,10 @@ class Wappalyzer {
Object.keys(patterns).forEach((cookieName) => {
if (typeof patterns[cookieName] !== 'function') {
cookieName = cookieName.toLowerCase();
const cookieNameLower = cookieName.toLowerCase();
promises.push(asyncForEach(patterns[cookieName], (pattern) => {
const cookie = cookies.find(_cookie => _cookie.name.toLowerCase() === cookieName);
const cookie = cookies.find(_cookie => _cookie.name.toLowerCase() === cookieNameLower);
if (cookie && pattern.regex.test(cookie.value)) {
addDetected(app, pattern, 'cookies', cookie.value, cookieName);

@ -12,6 +12,11 @@ const appsJson = {
test: 'test',
},
},
appUppercaseCookies: {
cookies: {
Test: 'Test',
},
},
appHeaders: {
headers: {
'X-Powered-By': 'test',
@ -111,6 +116,10 @@ describe('Wappalyzer', () => {
expect(apps).to.have.any.keys('appCookies');
});
it('should identify technologies using uppercase named cookies', () => {
expect(apps).to.have.any.keys('appUppercaseCookies');
});
it('should identify technologies using JavaScript', () => {
expect(apps).to.have.any.keys('appJs');
});