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

Implement the getSetCookie method of Headers #1315

Closed
ushiboy opened this issue Mar 16, 2024 · 0 comments · Fixed by #1326
Closed

Implement the getSetCookie method of Headers #1315

ushiboy opened this issue Mar 16, 2024 · 0 comments · Fixed by #1326
Assignees
Labels
enhancement New feature or request

Comments

@ushiboy
Copy link
Contributor

ushiboy commented Mar 16, 2024

Is your feature request related to a problem? Please describe.
In the happy-dom environment, the test fails because the getSetCookie method of Headers does not exist.

src/sample.test.ts > Headers.getSetCookie()
TypeError: headers.getSetCookie is not a function
 ❯ src/sample.test.ts:3:18
      1| test("Headers.getSetCookie()", () => {
      2|   const headers = new Headers();
      3|   expect(headers.getSetCookie()).toEqual([]);
       |                  ^
      4| 

Describe the solution you'd like
I'd like to see Headers getSetCookie implemented according to the specification.
see: https://developer.mozilla.org/en-US/docs/Web/API/Headers/getSetCookie

Describe alternatives you've considered
None.

Additional context
None.

@ushiboy ushiboy added the enhancement New feature or request label Mar 16, 2024
ushiboy pushed a commit to ushiboy/happy-dom that referenced this issue Mar 16, 2024
ushiboy pushed a commit to ushiboy/happy-dom that referenced this issue Mar 17, 2024
capricorn86 added a commit to ushiboy/happy-dom that referenced this issue Mar 18, 2024
… and removes logic for splitting cookie string
capricorn86 added a commit that referenced this issue Mar 18, 2024
* feat: [#1315] Implement the getSetCookie method of Headers

* feat: [#1315] Fixed handling of empty characters in headers

* chore: [#1315] Adds support for multiple values to Headers and removes logic for splitting cookie string

---------

Co-authored-by: ushiboy <ushiboy.dev@gmail.com>
Co-authored-by: David Ortner <david@ortner.se>
@capricorn86 capricorn86 self-assigned this Mar 18, 2024
@capricorn86 capricorn86 linked a pull request Mar 18, 2024 that will close this issue
capricorn86 added a commit that referenced this issue Mar 18, 2024
…okie-method-of-headers

chore: [#1315] Fixes problem with synd fetch headers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants