File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
src/main/java/com/microsoft/graph/httpcore Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -22,17 +22,27 @@ public static HttpClientBuilder custom() {
2222 * configuration.
2323 */
2424 public static CloseableHttpClient createDefault () {
25- //return HttpClientBuilder.create().build();
26-
2725 RequestConfig config = RequestConfig .custom ().setMaxRedirects (5 ).build ();
28-
29- IAuthenticationProvider auth = null ;
3026 return HttpClientBuilder .create ().addInterceptorFirst (new AuthenticationHandler (null ))
3127 .setRedirectStrategy (new RedirectHandler ())
3228 .setServiceUnavailableRetryStrategy (new RetryHandler ())
3329 .setDefaultRequestConfig (config )
3430 .build ();
3531 }
32+
33+ /**
34+ * Creates {@link CloseableHttpClient} instance with default
35+ * configuration and provided authProvider
36+ */
37+ public static CloseableHttpClient createDefault (IAuthenticationProvider auth ) {
38+ RequestConfig config = RequestConfig .custom ().setMaxRedirects (5 ).build ();
39+
40+ return HttpClientBuilder .create ().addInterceptorFirst (new AuthenticationHandler (auth ))
41+ .setRedirectStrategy (new RedirectHandler ())
42+ .setServiceUnavailableRetryStrategy (new RetryHandler ())
43+ .setDefaultRequestConfig (config )
44+ .build ();
45+ }
3646
3747 /**
3848 * Creates {@link CloseableHttpClient} instance with default
You can’t perform that action at this time.
0 commit comments