Skip to content

Commit c847c59

Browse files
committed
Use correct value when handling FQDNs
I do this by getting rid of the asciiDomain variable as that just makes it easier to use the wrong one.
1 parent a93e832 commit c847c59

File tree

1 file changed

+3
-4
lines changed
  • src/main/java/com/maxmind/minfraud/request

1 file changed

+3
-4
lines changed

src/main/java/com/maxmind/minfraud/request/Email.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,8 @@ private static boolean isValidDomain(String domain) {
525525
return false;
526526
}
527527

528-
String asciiDomain;
529528
try {
530-
asciiDomain = IDN.toASCII(domain);
529+
domain = IDN.toASCII(domain);
531530
} catch (IllegalArgumentException e) {
532531
return false;
533532
}
@@ -536,11 +535,11 @@ private static boolean isValidDomain(String domain) {
536535
domain = domain.substring(0, domain.length() - 1);
537536
}
538537

539-
if (asciiDomain.length() > 255) {
538+
if (domain.length() > 255) {
540539
return false;
541540
}
542541

543-
String[] labels = asciiDomain.split("\\.");
542+
String[] labels = domain.split("\\.");
544543

545544
if (labels.length < 2) {
546545
return false;

0 commit comments

Comments
 (0)