Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MockWebResponseBuilder can't handle null domain in cookie [SPR-14169] #18741

Closed
spring-issuemaster opened this issue Apr 14, 2016 · 2 comments
Closed
Assignees
Milestone

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Apr 14, 2016

Christopher Smith opened SPR-14169 and commented

This is a regression from 4.2, and any tests that set a cookie without explicitly setting the domain will fail when the setting request is made.

As part of the resolution for #18623, MockWebResponseBuilder was retrofitted in f5a5a81 to send the cookie on a round trip through HtmlUnit's Cookie class. The constructor for Cookie throws an exception if the cookie's domain is not set, as is rather typical with custom cookies and is acceptable per RFC 6265 5.3.

This seems to be a bug in HtmlUnit, but the Spring implementation should, if it's going to use the HtmlUnit algorithm as a utility, ensure that the domain is set to the domain of the request (e.g., localhost) if not otherwise specified in the javax.servlet.http.Cookie.


Affects: 4.3 RC1

Issue Links:

  • #18623 MockHttpServletResponse should convert Cookies into Set-Cookie header

Referenced from: pull request #1044

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Apr 25, 2016

Rob Winch commented

Thanks for the report Christopher Smith! I created a pull request for review.

cc Rossen Stoyanchev Sam Brannen

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Apr 25, 2016

Sam Brannen commented

Rob Winch, please see my comments on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.