mirror of
				https://github.com/microsoft/playwright.git
				synced 2025-06-26 21:40:17 +00:00 
			
		
		
		
	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
This commit is contained in:
		
							parent
							
								
									1101b46037
								
							
						
					
					
						commit
						3f3f332060
					
				@ -32,7 +32,7 @@ export class ZipTraceModelBackend implements TraceModelBackend {
 | 
				
			|||||||
    this._traceURL = traceURL;
 | 
					    this._traceURL = traceURL;
 | 
				
			||||||
    zipjs.configure({ baseURL: self.location.href } as any);
 | 
					    zipjs.configure({ baseURL: self.location.href } as any);
 | 
				
			||||||
    this._zipReader = new zipjs.ZipReader(
 | 
					    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 });
 | 
					        { useWebWorkers: false });
 | 
				
			||||||
    this._entriesPromise = this._zipReader.getEntries({ onprogress: progress }).then(entries => {
 | 
					    this._entriesPromise = this._zipReader.getEntries({ onprogress: progress }).then(entries => {
 | 
				
			||||||
      const map = new Map<string, zip.Entry>();
 | 
					      const map = new Map<string, zip.Entry>();
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user