fix: block domains in block list

Although a request is checked for a blocked domain, it is not actually
blocked.
This commit is contained in:
FineFindus
2024-06-21 21:23:00 +02:00
parent 998e186f8b
commit 76030c041c

View File

@@ -91,7 +91,11 @@ public class MastodonAPIController{
final boolean isBad = host == null || badDomains.stream().anyMatch(h -> h.equalsIgnoreCase(host) || host.toLowerCase().endsWith("." + h));
thread.postRunnable(()->{
try{
// if (isBad) throw new IllegalArgumentException();
if(isBad){
Log.i(TAG, "submitRequest: refusing to connect to bad domain: " + host);
throw new IllegalArgumentException("Failed to connect to domain");
}
if(req.canceled)
return;
Request.Builder builder=new Request.Builder()