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

expectCookiesLike Fails when cookies are set via setHeaders('Set-Cookie', cookieArray) #287

Closed
jmcdo29 opened this issue Jun 9, 2023 · 2 comments · Fixed by #388
Closed
Labels
bug Something isn't working

Comments

@jmcdo29
Copy link
Contributor

jmcdo29 commented Jun 9, 2023

Describe the bug

When multiple cookies are set via the res.setHeader('Set-Cookie', [cookie1, cookie2, ...cookieN]) format, as described in the node docs, lightcookie incorrectly parses the cookies that come in the response, even though a browser will proper interpret them.

To Reproduce

  1. Clone this repo.
  2. Run pnpm install
  3. Run pnpm test
  4. Notice the assertion error for the GET /two-cookies route

I kept the reproduction as barebones as possible using just pactum and express.

Expected behavior
Honestly, I'd say this should be something for lightcookie to fix in its parsing, but seeing as the project hasn't been touched since 2017, I figured this would be a better place to patch around it.

Screenshots
If applicable, add screenshots to help explain your problem.

Software (please complete the following information):

  • OS: [Linux]
  • NodeJS Version [e.g. 20]
  • Test Runner [N/A]

Additional context
Add any other context about the problem here.

@tomo324
Copy link
Contributor

tomo324 commented Dec 5, 2024

Hi! I previously encountered this bug during e2e testing.
I would like to fix this bug!

@leelaprasadv
Copy link
Member

@tomo324 Feel free to open a PR with the fix, we will be happy to review.

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.

4 participants