Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/templates/core/node/getHeaders.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async function getHeaders(options: ApiRequestOptions): Promise<Headers> {
}

if (options.body) {
if (isBinary(options.body)) {
if (isBinary(options.body) || options.body instanceof Stream) {
headers.append('Content-Type', 'application/octet-stream');
} else if (isString(options.body)) {
headers.append('Content-Type', 'text/plain');
Expand Down
2 changes: 1 addition & 1 deletion src/templates/core/node/getRequestBody.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function getRequestBody(options: ApiRequestOptions): BodyInit | undefined {
return getFormData(options.formData) as BodyInit;
}
if (options.body) {
if (isString(options.body) || isBinary(options.body) || options.body instanceof Stream)) {
if (isString(options.body) || isBinary(options.body) || options.body instanceof Stream) {
return options.body as BodyInit;
} else {
return JSON.stringify(options.body);
Expand Down