mirror of
https://github.com/google/nomulus
synced 2026-09-29 03:05:42 +00:00
Fix Spec11 domain check (#1105)
* Fix Spec11 domain check We should be checking to see if there are _any_ active domains for a given reported domain, not to see if _the_ domain for the name is active. The last change caused an exception for domains with soft-deleted past domains of the same name. The original code only checked the first domain returned from the query, which may have been soft-deleted. This version checks all domain records to see if any are active. * filter().count() -> anyMatch()
This commit is contained in:
@@ -136,13 +136,14 @@ public class Spec11EmailUtils {
|
||||
return registrarThreatMatches.threatMatches().stream()
|
||||
.filter(
|
||||
threatMatch ->
|
||||
tm().createQueryComposer(DomainBase.class)
|
||||
tm()
|
||||
.createQueryComposer(DomainBase.class)
|
||||
.where(
|
||||
"fullyQualifiedDomainName",
|
||||
Comparator.EQ,
|
||||
threatMatch.fullyQualifiedDomainName())
|
||||
.getSingleResult()
|
||||
.shouldPublishToDns())
|
||||
.stream()
|
||||
.anyMatch(DomainBase::shouldPublishToDns))
|
||||
.collect(toImmutableList());
|
||||
});
|
||||
return RegistrarThreatMatches.create(registrarThreatMatches.clientId(), filteredMatches);
|
||||
|
||||
Reference in New Issue
Block a user