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
Comment From: imvtsl
@sbrannen please review.
Comment From: sbrannen
Thanks for the PR, @imvtsl!
I'll take a look at it in the coming days.
Comment From: bclozel
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!