-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
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:
- MockHttpServletResponse should convert Cookies into Set-Cookie header [SPR-14051] #18623 MockHttpServletResponse should convert Cookies into Set-Cookie header
Referenced from: pull request #1044