Skip to content

Commit 2c1cfab

Browse files
authored
Merge pull request #1978 from aws/zoewang/relaxConnectionTimeToLiveValidation
Allow connectionTimeToLive to set to zero in netty http client.
2 parents 44e0e8b + 692bc3c commit 2c1cfab

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"category": "Netty NIO HTTP Client",
3+
"type": "bugfix",
4+
"description": "Fixed the issue where `connectionTimeToLive` was not allowed to set to zero. See [#1976](https://github.com/aws/aws-sdk-java-v2/issues/1976)"
5+
}

http-clients/netty-nio-client/src/main/java/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ public void setConnectionAcquisitionTimeout(Duration connectionAcquisitionTimeou
530530

531531
@Override
532532
public Builder connectionTimeToLive(Duration connectionTimeToLive) {
533-
Validate.isPositive(connectionTimeToLive, "connectionTimeToLive");
533+
Validate.isNotNegative(connectionTimeToLive, "connectionTimeToLive");
534534
standardOptions.put(SdkHttpConfigurationOption.CONNECTION_TIME_TO_LIVE, connectionTimeToLive);
535535
return this;
536536
}

0 commit comments

Comments
 (0)