Skip to content

Commit 8bead0f

Browse files
committed
Fix bug with cookies
1 parent e8e38f8 commit 8bead0f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/plugin.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,16 @@ export const init = (ctx, inject) => {
6161

6262
headers['Cookie'] = _.map(
6363
ctx.app.$cookies.getAll(),
64-
(value, index) => index + '=' + JSON.stringify(value)
64+
(value, index) => {
65+
let resValue = value
66+
if(typeof value === 'object') {
67+
resValue = JSON.stringify(resValue)
68+
}
69+
if (typeof value === 'array') {
70+
resValue = JSON.stringify(resValue)
71+
}
72+
return index + '=' + resValue
73+
}
6574
).join(';')
6675

6776
operation.setContext({

0 commit comments

Comments
 (0)