From 9466b8e00d5363b98007f750e1e2f6a24397544d Mon Sep 17 00:00:00 2001 From: maxkpower Date: Fri, 21 Nov 2025 14:57:16 +0100 Subject: [PATCH] remove redundant trailing slash check --- .../services/phishing-data.service.ts | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/apps/browser/src/dirt/phishing-detection/services/phishing-data.service.ts b/apps/browser/src/dirt/phishing-detection/services/phishing-data.service.ts index 91870c57a37..ad4ddbfa204 100644 --- a/apps/browser/src/dirt/phishing-detection/services/phishing-data.service.ts +++ b/apps/browser/src/dirt/phishing-detection/services/phishing-data.service.ts @@ -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;