From 898d681f93a13aa022f37e3cbdbc867355d1f654 Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Tue, 5 Nov 2024 11:16:00 -0800 Subject: [PATCH] fix cookie not being passed to replay regression: for now, add x-wabac-preset-cookie header for quick fix (same as AWP) longer fix will involve fixing CDXJ to include the header --- src/util/recorder.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/util/recorder.ts b/src/util/recorder.ts index be36cc3b..a485b988 100644 --- a/src/util/recorder.ts +++ b/src/util/recorder.ts @@ -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 = { "WARC-Page-ID": pageid, };