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

Add string type of header check#402

Open
iliapisaniy wants to merge 1 commit intorobinvdvleuten:masterfrom
iliapisaniy:add-header-check-on-readme-nuxt
Open

Add string type of header check#402
iliapisaniy wants to merge 1 commit intorobinvdvleuten:masterfrom
iliapisaniy:add-header-check-on-readme-nuxt

Conversation

@iliapisaniy
Copy link
Copy Markdown

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
Copy Markdown

Wils3B commented Apr 28, 2021

I Approve, It works

@robinvdvleuten
Copy link
Copy Markdown
Owner

Can you explain what you are trying to achieve here?

@davidrf88
Copy link
Copy Markdown

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.

4 participants