File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,10 +106,16 @@ export async function generateHar(
106106 events : readonly ViewableEvent [ ] ,
107107 options : HarGenerationOptions = { bodySizeLimit : HAR_BODY_SIZE_LIMIT }
108108) : Promise < Har > {
109- const [ exchanges , otherEvents ] = _ . partition ( events , e => e . isHttp ( ) ) as [
109+ const [ allExchanges , otherEvents ] = _ . partition ( events , e => e . isHttp ( ) ) as [
110110 HttpExchangeView [ ] , CollectedEvent [ ]
111111 ] ;
112112
113+ // Filter out exchanges with client errors (fundamental request parsing failures) -
114+ // these contain best-guess data that may not be valid in a HAR:
115+ const exchanges = allExchanges . filter ( e =>
116+ ! e . tags . some ( tag => tag . startsWith ( 'client-error:' ) )
117+ ) ;
118+
113119 const errors = otherEvents . filter ( e => e . isTlsFailure ( ) ) as FailedTlsConnection [ ] ;
114120
115121 const sourcePages = getSourcesAsHarPages ( exchanges ) ;
You can’t perform that action at this time.
0 commit comments