Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
fix: allow cookie domains starting with dot
Browse files Browse the repository at this point in the history
  • Loading branch information
simone-amadio-acn authored and tensor5 committed Jul 10, 2023
1 parent 91225ff commit fa299e9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/utils/cookieAuditLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,12 @@ async function checkCookieDomain(
is_correct: false,
};

const pageUrl = new URL(url).hostname;
const pageUrl = new URL(url).hostname.replaceAll("www.", "");

if (pageUrl === cookie.domain || cookie.domain.endsWith("." + pageUrl)) {
if (
pageUrl === cookie.domain.replaceAll("www.", "") ||
cookie.domain.endsWith("." + pageUrl)
) {
cookieValues.is_correct = true;
}

Expand Down

0 comments on commit fa299e9

Please sign in to comment.