mirror of
				https://github.com/microsoft/playwright.git
				synced 2025-06-26 21:40:17 +00:00 
			
		
		
		
	chore(route): wait for raw headers from browser in case of redirects (#31410)
Redirects are always autoresumed, so the will always receive extra info with raw headers. We only want to make raw headers available immediately when there is a route. Reference https://github.com/microsoft/playwright/issues/31351
This commit is contained in:
		
							parent
							
								
									de723f39e9
								
							
						
					
					
						commit
						2b12f53332
					
				@ -359,11 +359,11 @@ export class CRNetworkManager {
 | 
			
		||||
    });
 | 
			
		||||
    this._requestIdToRequest.set(requestWillBeSentEvent.requestId, request);
 | 
			
		||||
 | 
			
		||||
    if (requestPausedEvent) {
 | 
			
		||||
      // We will not receive extra info when intercepting the request.
 | 
			
		||||
    if (route) {
 | 
			
		||||
      // We may not receive extra info when intercepting the request.
 | 
			
		||||
      // Use the headers from the Fetch.requestPausedPayload and release the allHeaders()
 | 
			
		||||
      // right away, so that client can call it from the route handler.
 | 
			
		||||
      request.request.setRawRequestHeaders(headersOverride ?? headersObjectToArray(requestPausedEvent.request.headers, '\n'));
 | 
			
		||||
      request.request.setRawRequestHeaders(headersObjectToArray(requestPausedEvent!.request.headers, '\n'));
 | 
			
		||||
    }
 | 
			
		||||
    (this._page?._frameManager || this._serviceWorker)!.requestStarted(request.request, route || undefined);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user