File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import isPlainObject from 'lodash/isPlainObject'
44import isArray from 'lodash/isArray'
55import btoa from 'btoa'
66import url from 'url'
7- import { serialize as serializeCookie } from 'lightcookie '
7+ import cookie from 'cookie '
88import http , { mergeInQueryOrForm } from '../http'
99import 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
You can’t perform that action at this time.
0 commit comments