Update okhttp and okio versions
This commit is contained in:
parent
115f793733
commit
784161d66d
@ -83,15 +83,15 @@ public enum Dependency {
|
|||||||
OKIO(
|
OKIO(
|
||||||
"com{}squareup{}" + RelocationHelper.OKIO_STRING,
|
"com{}squareup{}" + RelocationHelper.OKIO_STRING,
|
||||||
RelocationHelper.OKIO_STRING,
|
RelocationHelper.OKIO_STRING,
|
||||||
"1.15.0",
|
"1.16.0",
|
||||||
"aT+jGafohDMAYCsgQCO3Z08Qbry1d/LdWAchK2YRi9I=",
|
"7ASE/xkDZA44RcKxCruZ7/LTIwj/40WeX5IwmkUbnH4=",
|
||||||
Relocation.of(RelocationHelper.OKIO_STRING, RelocationHelper.OKIO_STRING)
|
Relocation.of(RelocationHelper.OKIO_STRING, RelocationHelper.OKIO_STRING)
|
||||||
),
|
),
|
||||||
OKHTTP(
|
OKHTTP(
|
||||||
"com{}squareup{}" + RelocationHelper.OKHTTP3_STRING,
|
"com{}squareup{}" + RelocationHelper.OKHTTP3_STRING,
|
||||||
"okhttp",
|
"okhttp",
|
||||||
"3.11.0",
|
"3.12.0",
|
||||||
"4nx3QkSPgW2hyscrTKKDsNeSB0ngn13QrAF+QHFKLv4=",
|
"cXh/LFmeBEHHpEE5g7/dk9QLVuG63F4EE9akxIW6PzU=",
|
||||||
Relocation.allOf(
|
Relocation.allOf(
|
||||||
Relocation.of(RelocationHelper.OKHTTP3_STRING, RelocationHelper.OKHTTP3_STRING),
|
Relocation.of(RelocationHelper.OKHTTP3_STRING, RelocationHelper.OKHTTP3_STRING),
|
||||||
Relocation.of(RelocationHelper.OKIO_STRING, RelocationHelper.OKIO_STRING)
|
Relocation.of(RelocationHelper.OKIO_STRING, RelocationHelper.OKIO_STRING)
|
||||||
|
@ -32,12 +32,6 @@ import okhttp3.Response;
|
|||||||
import okhttp3.ResponseBody;
|
import okhttp3.ResponseBody;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.Proxy;
|
|
||||||
import java.net.ProxySelector;
|
|
||||||
import java.net.SocketAddress;
|
|
||||||
import java.net.URI;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utilities for the OkHttp client
|
* Utilities for the OkHttp client
|
||||||
@ -49,7 +43,6 @@ public class HttpClient {
|
|||||||
private static synchronized OkHttpClient getClient() {
|
private static synchronized OkHttpClient getClient() {
|
||||||
if (client == null) {
|
if (client == null) {
|
||||||
client = new OkHttpClient.Builder()
|
client = new OkHttpClient.Builder()
|
||||||
.proxySelector(new NullSafeProxySelector())
|
|
||||||
.addInterceptor(new LuckPermsUserAgentInterceptor())
|
.addInterceptor(new LuckPermsUserAgentInterceptor())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
@ -88,28 +81,6 @@ public class HttpClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// sometimes ProxySelector#getDefault returns null, and okhttp doesn't like that
|
|
||||||
private static final class NullSafeProxySelector extends ProxySelector {
|
|
||||||
private static final List<Proxy> DIRECT = Collections.singletonList(Proxy.NO_PROXY);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Proxy> select(URI uri) {
|
|
||||||
ProxySelector def = ProxySelector.getDefault();
|
|
||||||
if (def == null) {
|
|
||||||
return DIRECT;
|
|
||||||
}
|
|
||||||
return def.select(uri);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {
|
|
||||||
ProxySelector def = ProxySelector.getDefault();
|
|
||||||
if (def != null) {
|
|
||||||
def.connectFailed(uri, sa, ioe);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private HttpClient() {}
|
private HttpClient() {}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user