Skip to content

Commit 78ccfc3

Browse files
committed
Fix fetch so that we don't error when no body
Sometimes the response will not contain a body. When this happens an error is returned from chrome. We should ignore the error and return nil.
1 parent d9711e1 commit 78ccfc3

File tree

1 file changed

+3
-0
lines changed
  • internal/js/modules/k6/browser/common

1 file changed

+3
-0
lines changed

internal/js/modules/k6/browser/common/http.go

+3
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,9 @@ func (r *Response) fetchBody() error {
489489
}
490490
action := network.GetResponseBody(r.request.requestID)
491491
body, err := action.Do(cdp.WithExecutor(r.ctx, r.request.frame.manager.session))
492+
if err != nil && strings.Contains(err.Error(), "No data found for resource with given identifier") {
493+
return nil
494+
}
492495
if err != nil {
493496
return fmt.Errorf("fetching response body: %w", err)
494497
}

0 commit comments

Comments
 (0)