Merge pull request #433 from FineFindus/fix/blocks
fix: block domains in block list
This commit is contained in:
@@ -91,7 +91,11 @@ public class MastodonAPIController{
|
|||||||
final boolean isBad = host == null || badDomains.stream().anyMatch(h -> h.equalsIgnoreCase(host) || host.toLowerCase().endsWith("." + h));
|
final boolean isBad = host == null || badDomains.stream().anyMatch(h -> h.equalsIgnoreCase(host) || host.toLowerCase().endsWith("." + h));
|
||||||
thread.postRunnable(()->{
|
thread.postRunnable(()->{
|
||||||
try{
|
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)
|
if(req.canceled)
|
||||||
return;
|
return;
|
||||||
Request.Builder builder=new Request.Builder()
|
Request.Builder builder=new Request.Builder()
|
||||||
|
|||||||
Reference in New Issue
Block a user