Sitelet https://github.com/browserbase/sdk-node/pull/212
Skip to content

fix(core): let fetch compute content length - #212

Open
edenbuilds wants to merge 1 commit into
browserbase:mainfrom
edenbuilds:codex/hunt-sdk-node-197
Open

edenbuilds wants to merge 1 commit into
browserbase:mainfrom
edenbuilds:codex/hunt-sdk-node-197

Conversation

@edenbuilds

Copy link
Copy Markdown

Summary

  • Stop adding an explicit content-length header to SDK requests.
  • Let fetch/undici compute the value once from the actual body.
  • Replace the old header assertions with a regression test.

Verification

  • Regression test failed on the parent commit because content-length was present.
  • tests/index.test.ts: 31/31 passed after the fix.

Fixes #197

Do not send an explicit content-length header from the SDK. Fetch and undici
already compute it from the request body, and an explicit value can collide
with the computed header when consumers install a custom global dispatcher.

Fixes browserbase#197
@edenbuilds

Copy link
Copy Markdown
Author

Checking in on this one. It is mergeable against current main and its checks pass. Happy to change the approach if you prefer a different shape.

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.

content-length header collision → InvalidArgumentError: invalid content-length header when a custom undici global dispatcher is installed

1 participant