mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-03 23:15:44 +01:00
Improve content proxy domain matching.
This commit is contained in:
committed by
jeffrey-signal
parent
813252989b
commit
5db8463c70
@@ -32,9 +32,12 @@ public class ContentProxySelector extends ProxySelector {
|
||||
|
||||
@Override
|
||||
public List<Proxy> select(URI uri) {
|
||||
for (String domain : WHITELISTED_DOMAINS) {
|
||||
if (uri.getHost().endsWith(domain)) {
|
||||
return CONTENT;
|
||||
String host = uri.getHost();
|
||||
if (host != null) {
|
||||
for (String domain : WHITELISTED_DOMAINS) {
|
||||
if (host.equals(domain) || host.endsWith("." + domain)) {
|
||||
return CONTENT;
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Tried to proxy a non-whitelisted domain.");
|
||||
|
||||
Reference in New Issue
Block a user