Skip to content

Commit 69b15f2

Browse files
committed
amend
1 parent 03a268e commit 69b15f2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main/java/info/unterrainer/commons/restclient/RestClient.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class RestClient {
3434
private final Random random = new Random();
3535

3636
protected OkHttpClient client;
37+
protected final Map<String, CachingAuthenticator> authCache = new ConcurrentHashMap<>();
3738
protected final JsonMapper jsonMapper;
3839

3940
public RestClient(final JsonMapper jsonMapper) {
@@ -60,13 +61,11 @@ public RestClient(final JsonMapper jsonMapper, final String userName, final Stri
6061
.addInterceptor(new GzipInterceptor())
6162
.followRedirects(true);
6263
if (userName != null || password != null) {
63-
final Map<String, CachingAuthenticator> authCache = new ConcurrentHashMap<>();
64-
6564
Credentials credentials = new Credentials(userName, password);
6665
final BasicAuthenticator basicAuthenticator = new BasicAuthenticator(credentials);
6766
final DigestAuthenticator digestAuthenticator = new DigestAuthenticator(credentials);
6867

69-
// note that all auth schemes should be registered as lowercase!
68+
// Note that all authentication schemes should be registered as lower-case!
7069
DispatchingAuthenticator authenticator = new DispatchingAuthenticator.Builder()
7170
.with("digest", digestAuthenticator)
7271
.with("basic", basicAuthenticator)

0 commit comments

Comments
 (0)