1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-24 08:33:29 +00:00

remove redundant trailing slash check

This commit is contained in:
maxkpower
2025-11-21 14:57:16 +01:00
parent 53cd45514d
commit 9466b8e00d

View File

@@ -145,8 +145,8 @@ export class PhishingDataService {
// - "http://phish.com/login?param=value" (with query params)
for (const link of links) {
// Exact match (handles trailing slash differences)
if (link === normalizedUrl || link === normalizedUrl + "/") {
// Exact match (both link and normalizedUrl have trailing slashes removed)
if (link === normalizedUrl) {
return true;
}
@@ -155,17 +155,6 @@ export class PhishingDataService {
if (normalizedUrl.startsWith(link + "/") || normalizedUrl.startsWith(link + "?")) {
return true;
}
// Also check if the link in database has a trailing slash
if (link.endsWith("/")) {
const linkWithoutSlash = link.slice(0, -1);
if (
normalizedUrl === linkWithoutSlash ||
normalizedUrl.startsWith(linkWithoutSlash + "/")
) {
return true;
}
}
}
return false;