Skip to content

Send blob support#35

Open
CyBot wants to merge 2 commits into
mjwwit:masterfrom
iurio-com:send-blob-support
Open

Send blob support#35
CyBot wants to merge 2 commits into
mjwwit:masterfrom
iurio-com:send-blob-support

Conversation

@CyBot
Copy link
Copy Markdown

@CyBot CyBot commented May 15, 2026

Support sending Blob (and File) instances

Copy link
Copy Markdown
Owner

@mjwwit mjwwit left a comment

Choose a reason for hiding this comment

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

I think this only adds support for Blob in the asynchronous flow, not the synchronous one. This will make the behavior unpredictable. I realize the synchronous flow code isn't nice to work on, but I can't merge it like this.

Comment thread lib/XMLHttpRequest.js
// Node 0.4 and later won't accept empty data. Make sure it's needed.
if (data) {
if (data instanceof Blob) {
return stream.Readable.fromWeb(data.stream()).pipe(request);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This Node.js API only became available in Node.js 17. This project supports Node.js >=13. I'm not against raising the minimum version, but it will be a breaking change requiring a major release.

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