Skip to content

Update Cookie headers in MockHttpServletRequest and Response [SPR-15225] #19790

Closed
@spring-projects-issues

Description

@spring-projects-issues

Andy Wilkinson opened SPR-15225 and commented

When setContentType is called on MockHttpServletRequest or MockHttpServletResponse the Content-Type header is automatically updated. However, when setCookies is called on MockHttpServletRequest or addCookie is called on MockHttpServletResponse the respective Cookie and Set-Cookie headers are unaffected.

In the interests of consistency, I'd like setCookies and addCookie to automatically update the Cookie and Set-Cookie headers respectively. Setting the Cookie header would also provide an opportunity to apply the recommended ordering:

2.  The user agent SHOULD sort the cookie-list in the following
    order:

    *  Cookies with longer paths are listed before cookies with
       shorter paths.

    *  Among cookies that have equal-length path fields, cookies with
       earlier creation-times are listed before cookies with later
       creation-times.

Affects: 4.3.6

Issue Links:

Referenced from: commits 6e71828, e33f603, e5fc40a

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions