Skip to content

Commit 758678c

Browse files
authored
Bugfix: Ensure array-style 'set-cookie' headers are parsed correctly (#388)
1 parent 94d6d14 commit 758678c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/models/expect.js

+3
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ class Expect {
128128
if (!actualCookie) {
129129
this.fail(`'set-cookie' key not found in response headers`);
130130
}
131+
if (Array.isArray(actualCookie) && actualCookie.length > 1) {
132+
actualCookie = actualCookie.join('; ') + ';';
133+
}
131134
actualCookie = lc.parse(actualCookie);
132135
const msg = jlv.validate(actualCookie, expectedCookie, { target: 'Cookie' });
133136
if (msg) this.fail(msg);

0 commit comments

Comments
 (0)