Update okhttp and okio versions

This commit is contained in:
Luck 2018-12-19 10:06:08 +00:00
parent 115f793733
commit 784161d66d
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
2 changed files with 4 additions and 33 deletions

View File

@ -83,15 +83,15 @@ public enum Dependency {
OKIO(
"com{}squareup{}" + RelocationHelper.OKIO_STRING,
RelocationHelper.OKIO_STRING,
"1.15.0",
"aT+jGafohDMAYCsgQCO3Z08Qbry1d/LdWAchK2YRi9I=",
"1.16.0",
"7ASE/xkDZA44RcKxCruZ7/LTIwj/40WeX5IwmkUbnH4=",
Relocation.of(RelocationHelper.OKIO_STRING, RelocationHelper.OKIO_STRING)
),
OKHTTP(
"com{}squareup{}" + RelocationHelper.OKHTTP3_STRING,
"okhttp",
"3.11.0",
"4nx3QkSPgW2hyscrTKKDsNeSB0ngn13QrAF+QHFKLv4=",
"3.12.0",
"cXh/LFmeBEHHpEE5g7/dk9QLVuG63F4EE9akxIW6PzU=",
Relocation.allOf(
Relocation.of(RelocationHelper.OKHTTP3_STRING, RelocationHelper.OKHTTP3_STRING),
Relocation.of(RelocationHelper.OKIO_STRING, RelocationHelper.OKIO_STRING)

View File

@ -32,12 +32,6 @@ import okhttp3.Response;
import okhttp3.ResponseBody;
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
@ -49,7 +43,6 @@ public class HttpClient {
private static synchronized OkHttpClient getClient() {
if (client == null) {
client = new OkHttpClient.Builder()
.proxySelector(new NullSafeProxySelector())
.addInterceptor(new LuckPermsUserAgentInterceptor())
.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() {}
}