Skip to content

Commit 3f7c53c

Browse files
authored
Fix: Removed null check from getDefaultRequestConfigWithTimeout to create separate request configs (#498)
1 parent 395e8c9 commit 3f7c53c

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

core-httpclient-impl/src/main/java/com/optimizely/ab/HttpClientUtils.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright 2016-2017, 2019, Optimizely and contributors
3+
* Copyright 2016-2017, 2019, 2022-2023, Optimizely and contributors
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -39,13 +39,11 @@ private HttpClientUtils() {
3939
.build();
4040

4141
public static RequestConfig getDefaultRequestConfigWithTimeout(int timeoutMillis) {
42-
if (requestConfigWithTimeout == null) {
43-
requestConfigWithTimeout = RequestConfig.custom()
44-
.setConnectTimeout(timeoutMillis)
45-
.setConnectionRequestTimeout(CONNECTION_REQUEST_TIMEOUT_MS)
46-
.setSocketTimeout(SOCKET_TIMEOUT_MS)
47-
.build();
48-
}
42+
requestConfigWithTimeout = RequestConfig.custom()
43+
.setConnectTimeout(timeoutMillis)
44+
.setConnectionRequestTimeout(CONNECTION_REQUEST_TIMEOUT_MS)
45+
.setSocketTimeout(timeoutMillis)
46+
.build();
4947
return requestConfigWithTimeout;
5048
}
5149

0 commit comments

Comments
 (0)