Browse Source
Prior to this commit, there was no way to replace the Set-Cookie header via MockHttpServletResponse. Specifically, an invocation of setHeader() for the Set-Cookie header resulted in an additional Set-Cookie header instead of replacing the existing one, which is in violation of the contract for javax.servlet.http.HttpServletResponse.setHeader(...). This commit refactors the internals of MockHttpServletResponse to ensure that an existing Set-Cookie header is overwritten when set via an invocation of setHeader(). This commit also verifies the expected behavior for addHeader() and addCookie() with regard to multiple cookies. Closes gh-23512pull/23837/head
Sam Brannen
5 years ago
3 changed files with 107 additions and 23 deletions
Loading…
Reference in new issue