File tree Expand file tree Collapse file tree 2 files changed +20
-15
lines changed Expand file tree Collapse file tree 2 files changed +20
-15
lines changed Original file line number Diff line number Diff line change @@ -299,20 +299,16 @@ export function buildRequest(options) {
299299 // If the cookie convenience object exists in our request,
300300 // serialize its content and then delete the cookie object.
301301 if ( req . cookies && Object . keys ( req . cookies ) . length ) {
302- const cookieString = Object . keys ( req . cookies ) . reduce ( ( prev , cookieName ) => {
303- const cookieValue = req . cookies [ cookieName ] ;
304- const prefix = prev ? '&' : '' ;
305- const stringified = serializeCookie ( [ [ cookieName , cookieValue ] ] , {
306- encoders : {
307- value : cookieValueLenientEncoder ,
308- } ,
309- validators : {
310- name : cookieNameLenientValidator ,
311- value : cookieValueLenientValidator ,
312- } ,
313- } ) ;
314- return prev + prefix + stringified ;
315- } , '' ) ;
302+ const cookieString = serializeCookie ( req . cookies , {
303+ encoders : {
304+ value : cookieValueLenientEncoder ,
305+ } ,
306+ validators : {
307+ name : cookieNameLenientValidator ,
308+ value : cookieValueLenientValidator ,
309+ } ,
310+ } ) ;
311+
316312 req . headers . Cookie = cookieString ;
317313 }
318314
Original file line number Diff line number Diff line change @@ -474,6 +474,11 @@ describe('Authorization - OpenAPI Specification 3.0', () => {
474474 name : 'MyApiKeyCookie' ,
475475 in : 'cookie' ,
476476 } ,
477+ myApiKey1 : {
478+ type : 'apiKey' ,
479+ name : 'MyApiKeyCookie1' ,
480+ in : 'cookie' ,
481+ } ,
477482 } ,
478483 } ,
479484 paths : {
@@ -483,6 +488,7 @@ describe('Authorization - OpenAPI Specification 3.0', () => {
483488 security : [
484489 {
485490 myApiKey : [ ] ,
491+ myApiKey1 : [ ] ,
486492 } ,
487493 ] ,
488494 } ,
@@ -499,6 +505,9 @@ describe('Authorization - OpenAPI Specification 3.0', () => {
499505 myApiKey : {
500506 value : 'MyToken' ,
501507 } ,
508+ myApiKey1 : {
509+ value : 'MyToken1' ,
510+ } ,
502511 } ,
503512 } ,
504513 } ) ;
@@ -508,7 +517,7 @@ describe('Authorization - OpenAPI Specification 3.0', () => {
508517 url : '/' ,
509518 credentials : 'same-origin' ,
510519 headers : {
511- Cookie : 'MyApiKeyCookie=MyToken' ,
520+ Cookie : 'MyApiKeyCookie=MyToken; MyApiKeyCookie1=MyToken1 ' ,
512521 } ,
513522 } ) ;
514523 } ) ;
You can’t perform that action at this time.
0 commit comments