Describe the bug
In my application using the AWS SDK to access an S3 bucket I get in my logs several WARN messages coming from the SDK managed ApacheHttClient.
Example:
2021-04-19 14:34:27.916 WARN 1 --- [ scheduling-1] o.a.h.c.protocol.ResponseProcessCookies : Invalid cookie header: "Set-Cookie: AWSALB=IBgdfz13kcSqIebR9wDO4YsKku18wWVpnUE3SJjeOftddRj3F53UR9JAROlBRszd0rvjkzC5++wCOOvvNbyjEydLjwUeo7VT01zlt89RgskYeAw683mPa3SLKGlM; Expires=Mon, 26 Apr 2021 14:34:27 GMT; Path=/". Invalid 'expires' attribute: Mon, 26 Apr 2021 14:34:27 GMT,
2021-04-19 14:34:27.917 WARN 1 --- [ scheduling-1] o.a.h.c.protocol.ResponseProcessCookies : Invalid cookie header: "Set-Cookie: AWSALBCORS=IBgdfz13kcSqIebR9wDO4YsKku18wWVpnUE3SJjeOftddRj3F53UR9JAROlBRszd0rvjkzC5++wCOOvvNbyjEydLjwUeo7VT01zlt89RgskYeAw683mPa3SLKGlM; Expires=Mon, 26 Apr 2021 14:34:27 GMT; Path=/; SameSite=None; Secure". Invalid 'expires' attribute: Mon, 26 Apr 2021 14:34:27 GMT,
2021-04-19 14:34:29.969 WARN 1 --- [ scheduling-1] o.a.h.c.protocol.ResponseProcessCookies : Invalid cookie header: "Set-Cookie: AWSALB=L4KrWVU0sxSV5e0fJm3WsK+zBQBaNrtMnUjY8TuwIIG5B2/IzLHgz4gOWcrG5xFiIkYrHZ4dnIpdiGKDsmdumeOozBFnhC8ue6pPOXFD8V2se9oBRCgQS+K0aTdB; Expires=Mon, 26 Apr 2021 14:34:29 GMT; Path=/". Invalid 'expires' attribute: Mon, 26 Apr 2021 14:34:29 GMT,
2021-04-19 14:34:29.970 WARN 1 --- [ scheduling-1] o.a.h.c.protocol.ResponseProcessCookies : Invalid cookie header: "Set-Cookie: AWSALBCORS=L4KrWVU0sxSV5e0fJm3WsK+zBQBaNrtMnUjY8TuwIIG5B2/IzLHgz4gOWcrG5xFiIkYrHZ4dnIpdiGKDsmdumeOozBFnhC8ue6pPOXFD8V2se9oBRCgQS+K0aTdB; Expires=Mon, 26 Apr 2021 14:34:29 GMT; Path=/; SameSite=None; Secure". Invalid 'expires' attribute: Mon, 26 Apr 2021 14:34:29 GMT
The HttpClient should not emit those warnings.
Possible Solution
According to this StackOverFlow answer the warning is avoidable by using the following HttpClient configuration:
HttpClient httpClient = HttpClients.custom()
.setDefaultRequestConfig(RequestConfig.custom()
.setCookieSpec(CookieSpecs.STANDARD).build())
.build();
But I haven't found a way to inject the CookieSpec configuration into the Apache HttpClient managed by the SDK.
Your Environment
- AWS Java SDK version used: 2.15.60
- JDK version used: OpenJDK 11
- Operating System and version: Ubuntu Linux 18.04
Describe the bug
In my application using the AWS SDK to access an S3 bucket I get in my logs several WARN messages coming from the SDK managed ApacheHttClient.
Example:
The HttpClient should not emit those warnings.
Possible Solution
According to this StackOverFlow answer the warning is avoidable by using the following HttpClient configuration:
But I haven't found a way to inject the
CookieSpecconfiguration into the Apache HttpClient managed by the SDK.Your Environment