Skip to content

Commit

Permalink
去掉重复配置
Browse files Browse the repository at this point in the history
  • Loading branch information
pengjianbo committed Feb 18, 2016
1 parent ff57eb6 commit 79136d1
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,14 @@

import java.io.InputStream;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import javax.net.ssl.HostnameVerifier;

import cn.finalteam.okhttpfinal.https.HttpsCerManager;
import cn.finalteam.toolsfinal.StringUtils;
import okhttp3.CertificatePinner;
import okhttp3.CookieJar;
import okhttp3.Headers;
import okhttp3.OkHttpClient;
import okhttp3.internal.framed.Header;

/**
* Desction:
Expand All @@ -55,10 +51,8 @@ public synchronized void init(OkHttpFinalConfiguration configuration) {
OkHttpClient.Builder builder = new OkHttpClient.Builder()
.connectTimeout(timeout, TimeUnit.MILLISECONDS)
.writeTimeout(timeout, TimeUnit.MILLISECONDS)
.readTimeout(timeout, TimeUnit.MILLISECONDS)
.retryOnConnectionFailure(false)
.followRedirects(true);
if ( getHostnameVerifier() != null ) {
.readTimeout(timeout, TimeUnit.MILLISECONDS);
if ( configuration.getHostnameVerifier() != null ) {
builder.hostnameVerifier(configuration.getHostnameVerifier());
}

Expand Down

0 comments on commit 79136d1

Please sign in to comment.