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

Cookie value cuts at = sign #1570

Closed
rijenkii opened this issue Oct 28, 2024 · 1 comment · Fixed by #1573
Closed

Cookie value cuts at = sign #1570

rijenkii opened this issue Oct 28, 2024 · 1 comment · Fixed by #1573
Labels
bug Something isn't working

Comments

@rijenkii
Copy link

Describe the bug
Cookie values can contain = symbols. Browsers allow them, happy-dom only saves the part before the first =.

To Reproduce
Steps to reproduce the behavior:

rijenkii@rijenkiipc /t/hd
> npm install happy-dom

added 4 packages in 1s

1 package is looking for funding
  run `npm fund` for details
rijenkii@rijenkiipc /t/hd
> node
Welcome to Node.js v20.18.0.
Type ".help" for more information.
> const document = new (require("happy-dom")).Window().document;
undefined
> document.cookie = "hello=beautiful=world"
'hello=beautiful=world'
> document.cookie
'hello=beautiful'

Expected behavior
Expected the whole cookie to be saved.

Additional context

const [key, value] = parts.shift().split('=');

@rijenkii rijenkii added the bug Something isn't working label Oct 28, 2024
btea added a commit to btea/happy-dom that referenced this issue Nov 2, 2024
capricorn86 added a commit that referenced this issue Nov 6, 2024
#1573)

* fix: [#1570] Cookie value support contain `=`

* chore: [#1570] Changed logic to improve performance

---------

Co-authored-by: David Ortner <david@ortner.se>
@capricorn86
Copy link
Owner

Thank you for reporting @rijenkii! 🙂

Thanks to @btea we now have a fix ⭐

You can read more about the release here:
https://github.com/capricorn86/happy-dom/releases/tag/v15.10.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants