Skip to content

Commit

Permalink
feat(trace): allow Trace Viewer to include credentials when fetching …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
pmattj committed Dec 14, 2023
1 parent 1101b46 commit 3f3f332
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/trace-viewer/src/traceModelBackends.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, zip.Entry>();
Expand Down

0 comments on commit 3f3f332

Please sign in to comment.