Preserve expires attribute in MockCookie#23769
Closed
vpavic wants to merge 1 commit into
Closed
Conversation
At present, MockCookie doesn't preserve expires attribute. This has a consequence that cookie value set using MockHttpServletResponse#addHeader containing expires attribute will not match the cookie value obtained from MockHttpServletResponse#getHeader since the expires will get calculated based on current time. This commit enhances MockCookie to preserve expires attribute.
Contributor
Author
|
Any feedback on this? The current behavior, illustrated by test in the opening comment, is effectively a bug. |
Member
|
Sorry for the delayed response. This one slipped under the radar. It looks legit to me, so we'll try to get this in for 5.1.11 and 5.2.1. |
Member
|
For future reference, please wrap commit message descriptions at 72 characters. |
Member
|
Also, the imports in |
sbrannen
added a commit
that referenced
this pull request
Oct 29, 2019
sbrannen
pushed a commit
that referenced
this pull request
Oct 29, 2019
At present, MockCookie doesn't preserve expires attribute. This has a consequence that a cookie value set using MockHttpServletResponse#addHeader containing an expires attribute will not match the cookie value obtained from MockHttpServletResponse#getHeader, since the expires attribute will get calculated based on current time. This commit enhances MockCookie to preserve the expires attribute. Closes gh-23769
sbrannen
added a commit
that referenced
this pull request
Oct 29, 2019
Contributor
Author
|
Thanks for taking care of this @sbrannen! 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At present,
MockCookiedoesn't preserve expires attribute. This has a consequence that cookie value set usingMockHttpServletResponse#addHeadercontaining expires attribute will not match the cookie value obtained fromMockHttpServletResponse#getHeadersince the expires will get calculated based on current time.This is very simple to demonstrate using a test that's added to
MockHttpServletResponseTestsas a part of this PR:This PR enhances
MockCookieto preserve expires attribute.