Skip to content

Commit 7925b74

Browse files
author
Stephane Landelle
committed
Merge pull request AsyncHttpClient#539 from Dieken/master
correct default value for maxConnectionLifetimeInMs and enable customization of strict302Handling
2 parents 63c5141 + bdaddbc commit 7925b74

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

api/src/main/java/org/asynchttpclient/AsyncHttpClientConfigBean.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ void configureDefaults() {
5151
idleConnectionInPoolTimeoutInMs = Integer.getInteger(ASYNC_CLIENT + "defaultIdleConnectionInPoolTimeoutInMS", 60 * 1000);
5252
idleConnectionTimeoutInMs = Integer.getInteger(ASYNC_CLIENT + "defaultIdleConnectionTimeoutInMS", 60 * 1000);
5353
requestTimeoutInMs = Integer.getInteger(ASYNC_CLIENT + "defaultRequestTimeoutInMS", 60 * 1000);
54+
maxConnectionLifeTimeInMs = Integer.getInteger(ASYNC_CLIENT + "defaultMaxConnectionLifeTimeInMs", -1);
5455
redirectEnabled = Boolean.getBoolean(ASYNC_CLIENT + "defaultRedirectsEnabled");
5556
maxDefaultRedirects = Integer.getInteger(ASYNC_CLIENT + "defaultMaxRedirects", 5);
5657
compressionEnabled = Boolean.getBoolean(ASYNC_CLIENT + "compressionEnabled");
@@ -99,6 +100,11 @@ public AsyncHttpClientConfigBean setConnectionTimeOutInMs(int connectionTimeOutI
99100
return this;
100101
}
101102

103+
public AsyncHttpClientConfigBean setMaxConnectionLifeTimeInMs(int maxConnectionLifeTimeInMs) {
104+
this.maxConnectionLifeTimeInMs = maxConnectionLifeTimeInMs;
105+
return this;
106+
}
107+
102108
public AsyncHttpClientConfigBean setIdleConnectionInPoolTimeoutInMs(int idleConnectionInPoolTimeoutInMs) {
103109
this.idleConnectionInPoolTimeoutInMs = idleConnectionInPoolTimeoutInMs;
104110
return this;
@@ -124,6 +130,11 @@ public AsyncHttpClientConfigBean setMaxDefaultRedirects(int maxDefaultRedirects)
124130
return this;
125131
}
126132

133+
public AsyncHttpClientConfigBean setStrict302Handling(boolean strict302Handling) {
134+
this.strict302Handling = strict302Handling;
135+
return this;
136+
}
137+
127138
public AsyncHttpClientConfigBean setCompressionEnabled(boolean compressionEnabled) {
128139
this.compressionEnabled = compressionEnabled;
129140
return this;

0 commit comments

Comments
 (0)