Skip to content

Commit

Permalink
Bugfix: Ensure array-style 'set-cookie' headers are parsed correctly (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tomo324 authored Dec 6, 2024
1 parent 94d6d14 commit 758678c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/models/expect.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ class Expect {
if (!actualCookie) {
this.fail(`'set-cookie' key not found in response headers`);
}
if (Array.isArray(actualCookie) && actualCookie.length > 1) {
actualCookie = actualCookie.join('; ') + ';';
}
actualCookie = lc.parse(actualCookie);
const msg = jlv.validate(actualCookie, expectedCookie, { target: 'Cookie' });
if (msg) this.fail(msg);
Expand Down

0 comments on commit 758678c

Please sign in to comment.