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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user