Skip to content

Commit e818eb1

Browse files
committed
lightcookie -> cookie
1 parent 3b90d30 commit e818eb1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@
6363
"dependencies": {
6464
"babel-runtime": "^6.23.0",
6565
"btoa": "1.1.2",
66+
"cookie": "^0.3.1",
6667
"deep-extend": "^0.4.1",
6768
"fast-json-patch": "1.1.8",
6869
"isomorphic-fetch": "2.2.1",
6970
"isomorphic-form-data": "0.0.1",
7071
"js-yaml": "^3.8.1",
71-
"lightcookie": "^1.0.24",
7272
"lodash": "4.16.2",
7373
"qs": "^6.3.0",
7474
"url": "^0.11.0"

src/execute/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import isPlainObject from 'lodash/isPlainObject'
44
import isArray from 'lodash/isArray'
55
import btoa from 'btoa'
66
import url from 'url'
7-
import {serialize as serializeCookie} from 'lightcookie'
7+
import cookie from 'cookie'
88
import http, {mergeInQueryOrForm} from '../http'
99
import createError from '../specmap/lib/create-error'
1010

@@ -209,7 +209,12 @@ export function buildRequest(options) {
209209
// If the cookie convenience object exists in our request,
210210
// serialize its content and then delete the cookie object.
211211
if (req.cookies && Object.keys(req.cookies).length) {
212-
const cookieString = serializeCookie(req.cookies)
212+
const cookieString = Object.keys(req.cookies).reduce((prev, cookieName) => {
213+
const cookieValue = req.cookies[cookieName]
214+
const prefix = prev ? '&' : ''
215+
const stringified = cookie.serialize(cookieName, cookieValue)
216+
return prev + prefix + stringified
217+
}, '')
213218
req.headers.Cookie = cookieString
214219
}
215220

0 commit comments

Comments
 (0)