spring-framework icon indicating copy to clipboard operation
spring-framework copied to clipboard

Merge Expires and Max-Age attributes

Open imvtsl opened this issue 1 year ago • 2 comments

org.springframework.http.client.reactive.ClientHttpResponse and its implementations don't process Expires Cookie attribute. However, they only process Max-Age attribute.

Logic defined in RFC 6265. Point 3 of section 5.3 in this RFC gives higher precedence to Max-Age over Expires. This change follows this RFC and does the following: 1- If both Max-Age and Expires attribute are present in the cookie, set maxAge field in ResponseCookie to Max-Age attribute. 2- If only Expires attribute is present in the cookie, set maxAge field in ResponseCookie to Expires attribute. 2- If only Max-Age attribute is present in the cookie, set maxAge field in ResponseCookie to Max-Age attribute.

Closes https://github.com/spring-projects/spring-framework/issues/33157

imvtsl avatar Aug 12 '24 06:08 imvtsl

@sbrannen please review.

imvtsl avatar Aug 13 '24 02:08 imvtsl

Thanks for the PR, @imvtsl!

I'll take a look at it in the coming days.

sbrannen avatar Aug 24 '24 10:08 sbrannen

Sorry for the late feedback @imvtsl In the end, we went with a simpler approach in #33157 as this PR was creating new public API and the tests were too involved.

Thanks for your contribution!

bclozel avatar Sep 13 '24 13:09 bclozel