vuex-persistedstate icon indicating copy to clipboard operation
vuex-persistedstate copied to clipboard

Add string type of header check

Open iliapisaniy opened this issue 3 years ago • 3 comments

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
  • [x] Ready to be merged
  • [ ] Added myself to contributors table

Issue #398

iliapisaniy avatar Mar 07 '21 20:03 iliapisaniy

I Approve, It works

Wils3B avatar Apr 28 '21 08:04 Wils3B

Can you explain what you are trying to achieve here?

robinvdvleuten avatar Jul 19 '21 10:07 robinvdvleuten

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

davidrf88 avatar Oct 12 '21 01:10 davidrf88