Skip to content

Commit

Permalink
fix cookie not being passed to replay regression
Browse files Browse the repository at this point in the history
- for now, add x-wabac-preset-cookie header for quick fix (same as AWP)
- more permanent fix will involve fixing warcio.js indexing to include the header
- fix replay of X captures and other pages requiring cookies
  • Loading branch information
ikreymer authored Nov 5, 2024
1 parent edbb1c1 commit 3187685
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/util/recorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1751,6 +1751,13 @@ function createResponse(

const httpHeaders = reqresp.getResponseHeadersDict(reqresp.payload.length);

const cookie =
reqresp.requestHeaders &&
(reqresp.requestHeaders["cookie"] || reqresp.requestHeaders["Cookie"]);
if (cookie) {
httpHeaders["x-wabac-preset-cookie"] = cookie;
}

const warcHeaders: Record<string, string> = {
"WARC-Page-ID": pageid,
};
Expand Down

0 comments on commit 3187685

Please sign in to comment.