File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed
src/main/java/com/opentok Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -71,10 +71,7 @@ public OpenTok(int apiKey, String apiSecret) {
71
71
72
72
this .apiKey = apiKey ;
73
73
this .apiSecret = apiSecret ;
74
-
75
- HttpClient .Builder clientBuilder = new HttpClient .Builder (apiKey , apiSecret ).apiUrl (DefaultApiUrl .DEFAULT_API_URI );
76
-
77
- this .client = clientBuilder .build ();
74
+ this .client = new HttpClient .Builder (apiKey , apiSecret ).build ();
78
75
}
79
76
80
77
private OpenTok (int apiKey , String apiSecret , HttpClient httpClient ) {
@@ -525,8 +522,7 @@ public OpenTok build() {
525
522
if (this .apiUrl != null ) {
526
523
clientBuilder .apiUrl (this .apiUrl );
527
524
}
528
- if (this .proxy !=null )
529
- {
525
+ if (this .proxy !=null ) {
530
526
clientBuilder .proxy (this .proxy );
531
527
}
532
528
Original file line number Diff line number Diff line change
1
+ /**
2
+ * OpenTok Java SDK
3
+ * Copyright (C) 2016 TokBox, Inc.
4
+ * http://www.tokbox.com
5
+ *
6
+ * Licensed under The MIT License (MIT). See LICENSE file for more information.
7
+ */
1
8
package com .opentok .constants ;
2
9
3
10
public class DefaultApiUrl
Original file line number Diff line number Diff line change 25
25
import com .ning .http .client .filter .FilterException ;
26
26
import com .ning .http .client .filter .RequestFilter ;
27
27
import com .opentok .ArchiveProperties ;
28
+ import com .opentok .constants .DefaultApiUrl ;
28
29
import com .opentok .constants .Version ;
29
30
import com .opentok .exception .OpenTokException ;
30
31
import com .opentok .exception .RequestException ;
@@ -311,9 +312,15 @@ public HttpClient build() {
311
312
AsyncHttpClientConfig .Builder configBuilder = new AsyncHttpClientConfig .Builder ()
312
313
.setUserAgent ("Opentok-Java-SDK/" + Version .VERSION + " JRE/" + System .getProperty ("java.version" ))
313
314
.addRequestFilter (new PartnerAuthRequestFilter (this .apiKey , this .apiSecret ));
315
+
316
+ if (this .apiUrl ==null ) {
317
+ this .apiUrl =DefaultApiUrl .DEFAULT_API_URI ;
318
+ }
319
+
314
320
if (this .proxy != null ) {
315
321
configBuilder .setProxyServer (createProxyServer (this .proxy ));
316
322
}
323
+
317
324
this .config = configBuilder .build ();
318
325
// NOTE: not thread-safe, config could be modified by another thread here?
319
326
HttpClient client = new HttpClient (this );
You can’t perform that action at this time.
0 commit comments