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

Open
jmcdo29 opened this issue Jun 9, 2023 · 0 comments
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.

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

No branches or pull requests

2 participants