Skip to content

Commit

Permalink
Only send 4 characters to the matches endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
CrisBarreiro committed Dec 19, 2024
1 parent 36e54ef commit 95b3a46
Show file tree
Hide file tree
Showing 6 changed files with 1,387,089 additions and 20,164 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class RealMaliciousSiteProtection @Inject constructor(
hostname: String,
hash: String,
): Boolean {
val matches = maliciousSiteRepository.matches(hashPrefix)
val matches = maliciousSiteRepository.matches(hashPrefix.substring(0, 4))
return matches.any { match ->
Pattern.compile(match.regex).matcher(url.toString()).find() &&
(hostname == match.hostname) &&
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit 95b3a46

Please sign in to comment.