Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Add string type of header check #402

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add string type of header check #402

wants to merge 1 commit into from

Conversation

ilyapisany
Copy link

What: Bug in case of using nuxt ssr plugin from readme

Why:

How: Check type of cookie header and set to string if not

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table

Issue #398

@Wils3B
Copy link

Wils3B commented Apr 28, 2021

I Approve, It works

@robinvdvleuten
Copy link
Owner

Can you explain what you are trying to achieve here?

@davidrf88
Copy link

davidrf88 commented Oct 12, 2021

when using it in conjuction with the cookie package in a project with nuxt ssr the first time it runs the plugin mentioned in the readme file throws an error because the req.headers.cookie is undefined, that cuses that the cookie.parse function throws an error since it is expecting a string not an undefined. I solved by just adding

if (process.server && req.headers.cookie)

that produces the same result as the solution in this request

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants