Skip to content

fix(har): do not report zero sizes for bodies that were never read - #42564

Merged
Dmitry Gozman (dgozman) merged 1 commit into
microsoft:mainfrom
dgozman:fix-42370
Sep 4, 2026
Merged

Dmitry Gozman (dgozman) merged 1 commit into
microsoft:mainfrom
dgozman:fix-42370

Conversation

@dgozman

Copy link
Copy Markdown
Collaborator

Summary

  • APIRequestContext destroys the request on a redirect and on the 401 basic-auth retry before reading the body, so the har tracer recorded bodySize/content.size as 0 for those hops, contradicting the Content-Length header in the same entry.
  • Keep the -1 "not available" sentinel instead, matching what the browser path already does.

Fixes #42370

APIRequestContext destroys the request on a redirect and on the 401
basic-auth retry before reading the body, so the har tracer recorded
bodySize/content.size as 0 for those hops, contradicting the
Content-Length header in the same entry. Keep the -1 "not available"
sentinel instead, matching what the browser path already does.

Fixes: microsoft#42370
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

7 flaky ⚠️ [installation tests] › playwright-test-package-managers.spec.ts:28 › npm: playwright + @playwright/test should work `@package-installations-ubuntu-latest`
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:897 › run-server › socks proxy › should proxy localhost requests Radoslav Kirilov (@smoke) `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/chromium/chromium.spec.ts:213 › should intercept service worker requests (main and within) `@chromium-ubuntu-22.04-arm-node20`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:257 › third party 'Partitioned;' cookies `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:470 › top level 'Partitioned;' cookie and same origin iframe `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-page] › page/page-goto.spec.ts:90 › should work with Cross-Origin-Opener-Policy `@firefox-ubuntu-22.04-node20`
⚠️ [playwright-test] › ui-mode-trace.spec.ts:388 › should reveal errors in the sourcetab `@windows-latest-node22`

51333 passed, 1247 skipped


Merge workflow run.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Test results for "MCP"

2 failed
❌ [chrome] › mcp/annotate.spec.ts:291 › should enter annotate mode on fresh dashboard.tsx mount with -s --annotate @mcp-windows-latest-chrome
❌ [firefox] › mcp/cli-core.spec.ts:394 › --raw on command without output @mcp-windows-latest-firefox

8325 passed, 1371 skipped


Merge workflow run.

@dgozman
Dmitry Gozman (dgozman) merged commit ca667fe into microsoft:main Sep 4, 2026
43 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: HAR records bodySize 0 for redirect hops whose body was never read

2 participants