mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-26 09:47:13 +00:00
IDN for owner check
This commit is contained in:
parent
02bd0a3af3
commit
4c3c1b12e4
1 changed files with 6 additions and 0 deletions
|
@ -29,6 +29,7 @@ import androidx.core.net.MailTo;
|
|||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.net.IDN;
|
||||
import java.net.InetAddress;
|
||||
import java.net.URL;
|
||||
import java.net.UnknownHostException;
|
||||
|
@ -57,6 +58,11 @@ public class IPInfo {
|
|||
String host = uri.getHost();
|
||||
if (host == null)
|
||||
throw new UnknownHostException();
|
||||
try {
|
||||
host = IDN.toASCII(host, IDN.ALLOW_UNASSIGNED);
|
||||
} catch (Throwable ex) {
|
||||
Log.i(ex);
|
||||
}
|
||||
InetAddress address = InetAddress.getByName(host);
|
||||
return new Pair<>(address, getOrganization(address, context));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue