From 6841d8d18ddc71cc1bd202ffcfddb3f95622eef3 Mon Sep 17 00:00:00 2001 From: Henco Appel Date: Sun, 13 Oct 2024 18:43:40 +0100 Subject: [PATCH] fix(http): add support for File objects as payload in http adapter (#6588) (#6605) Co-authored-by: Hendrik Appel Co-authored-by: Jay Co-authored-by: Dmitriy Mozgovoy --- lib/adapters/http.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/adapters/http.js b/lib/adapters/http.js index 70cb5cf..c6c603f 100755 --- a/lib/adapters/http.js +++ b/lib/adapters/http.js @@ -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));