This repository was archived by the owner on Mar 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 26
26
27
27
import android .content .Context ;
28
28
29
+ import com .owncloud .android .lib .BuildConfig ;
29
30
import com .owncloud .android .lib .common .network .AdvancedX509TrustManager ;
30
31
import com .owncloud .android .lib .common .network .NetworkUtils ;
31
32
import okhttp3 .Cookie ;
@@ -112,7 +113,6 @@ public List<Cookie> loadForRequest(HttpUrl url) {
112
113
113
114
OkHttpClient .Builder clientBuilder = new OkHttpClient .Builder ()
114
115
.protocols (Arrays .asList (Protocol .HTTP_1_1 ))
115
- .addInterceptor (getLogInterceptor ())
116
116
.readTimeout (HttpConstants .DEFAULT_DATA_TIMEOUT , TimeUnit .MILLISECONDS )
117
117
.writeTimeout (HttpConstants .DEFAULT_DATA_TIMEOUT , TimeUnit .MILLISECONDS )
118
118
.connectTimeout (HttpConstants .DEFAULT_CONNECTION_TIMEOUT , TimeUnit .MILLISECONDS )
@@ -122,6 +122,12 @@ public List<Cookie> loadForRequest(HttpUrl url) {
122
122
.cookieJar (cookieJar );
123
123
// TODO: Not verifying the hostname against certificate. ask owncloud security human if this is ok.
124
124
//.hostnameVerifier(new BrowserCompatHostnameVerifier());
125
+
126
+ // Http logs enabled only in debug version. TODO: Add an option to enable and disable it.
127
+ if (BuildConfig .DEBUG ) {
128
+ clientBuilder .addInterceptor (getLogInterceptor ());
129
+ }
130
+
125
131
sOkHttpClient = clientBuilder .build ();
126
132
127
133
} catch (Exception e ) {
You can’t perform that action at this time.
0 commit comments