Skip to content

Commit

Permalink
fix(http): add support for File objects as payload in http adapter (#…
Browse files Browse the repository at this point in the history
…6588) (#6605)

Co-authored-by: Hendrik Appel <happel@europe.altair.com>
Co-authored-by: Jay <jasonsaayman@gmail.com>
Co-authored-by: Dmitriy Mozgovoy <robotshara@gmail.com>
  • Loading branch information
4 people authored Oct 13, 2024
1 parent 17cab9c commit 6841d8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/adapters/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export default isHttpAdapterSupported && function httpAdapter(config) {
} catch (e) {
}
}
} else if (utils.isBlob(data)) {
} else if (utils.isBlob(data) || utils.isFile(data)) {
data.size && headers.setContentType(data.type || 'application/octet-stream');
headers.setContentLength(data.size || 0);
data = stream.Readable.from(readBlob(data));
Expand Down

0 comments on commit 6841d8d

Please sign in to comment.