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

Remove multiple cookies #4824

Merged
merged 2 commits into from May 18, 2021
Merged

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.

None yet

2 participants