Improve content proxy domain matching.

This commit is contained in:
Greyson Parrelli
2026-04-09 22:17:53 -04:00
committed by jeffrey-signal
parent 813252989b
commit 5db8463c70

View File

@@ -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.");