Skip to content

Remove multiple cookies#4824

Merged
rossabaker merged 2 commits intohttp4s:mainfrom
phiSgr:remove-multiple-cookies
May 18, 2021
Merged

Remove multiple cookies#4824
rossabaker merged 2 commits intohttp4s:mainfrom
phiSgr:remove-multiple-cookies

Conversation

@phiSgr
Copy link
Contributor

@phiSgr phiSgr commented May 13, 2021

Because putHeaders deduplicates, calling removeCookie repeatedly will remove the first one.

Copy link
Member

@rossabaker rossabaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think we should backport this to 0.22, as the new header model originates there.

def clearCookie: headers.`Set-Cookie` =
headers.`Set-Cookie`(copy(content = "", expires = Some(HttpDate.Epoch)))
def clearCookie: ResponseCookie =
copy(content = "", expires = Some(HttpDate.Epoch))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using copy leaves other attributes. Is this desirable? I think yes?

@rossabaker rossabaker added bug Determined to be a bug in http4s module:core labels May 16, 2021
@rossabaker rossabaker added this to the 0.22 milestone May 16, 2021
@rossabaker rossabaker added the retarget Cherry-pick or reopen on another branch label May 16, 2021
@rossabaker rossabaker merged commit e951f41 into http4s:main May 18, 2021
@rossabaker
Copy link
Member

Argh, I meant to cherry-pick this!

rossabaker pushed a commit that referenced this pull request May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Determined to be a bug in http4s module:core retarget Cherry-pick or reopen on another branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants