From 3f3f33206004d7d1b46b614e1db5cc13fc384b79 Mon Sep 17 00:00:00 2001 From: Matt Jennings Date: Thu, 14 Dec 2023 10:41:01 -0800 Subject: [PATCH] feat(trace): allow Trace Viewer to include credentials when fetching traces cross-origin (#28502) Add the `'credentials': include` option on the trace fetch so the browser can include cookies when fetching from a different origin, assuming the origin returns the correct Access-Control-Allow-Origin and Access-Control-Allow-Credentials headers. Fixes #28501 --- packages/trace-viewer/src/traceModelBackends.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/trace-viewer/src/traceModelBackends.ts b/packages/trace-viewer/src/traceModelBackends.ts index 19c5fc2deec52..71c8f40d3906a 100644 --- a/packages/trace-viewer/src/traceModelBackends.ts +++ b/packages/trace-viewer/src/traceModelBackends.ts @@ -32,7 +32,7 @@ export class ZipTraceModelBackend implements TraceModelBackend { this._traceURL = traceURL; zipjs.configure({ baseURL: self.location.href } as any); this._zipReader = new zipjs.ZipReader( - new zipjs.HttpReader(formatUrl(traceURL), { mode: 'cors', preventHeadRequest: true } as any), + new zipjs.HttpReader(formatUrl(traceURL), { mode: 'cors', credentials: 'include', preventHeadRequest: true } as any), { useWebWorkers: false }); this._entriesPromise = this._zipReader.getEntries({ onprogress: progress }).then(entries => { const map = new Map();