Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(js): Fix multipart upload with overridden node fetch #1235

Merged
merged 3 commits into from
Nov 20, 2024

Conversation

jacoblee93
Copy link
Collaborator

No description provided.

@jacoblee93 jacoblee93 requested a review from nfcampos November 20, 2024 08:40
},
body: formData,
body: arrayBuffer,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fetch automatically set content length header from array buffer length?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works so I assumed it wasn't necessary but will populate

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude says:

Note: In many cases, modern HTTP clients and the Fetch API will automatically set the correct Content-Length header when you provide a body. You could also remove the Content-Length header entirely and let the client handle it automatically.

It seems to work in tests with native fetch and Node fetch, and I wasn't doing it before - can manually populate if preferred

@jacoblee93 jacoblee93 merged commit 7670d0f into main Nov 20, 2024
11 checks passed
@jacoblee93 jacoblee93 deleted the jacob/nodefetch branch November 20, 2024 16:52
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.

2 participants