Skip to content

Commit f6cdffe

Browse files
authored
Merge pull request #2 from t0ggah/fix/remove-paranthese-template
Remove wrong parenthese and correct header for Stream request body
2 parents a80d1d5 + aa01893 commit f6cdffe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/templates/core/node/getHeaders.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async function getHeaders(options: ApiRequestOptions): Promise<Headers> {
1919
}
2020

2121
if (options.body) {
22-
if (isBinary(options.body)) {
22+
if (isBinary(options.body) || options.body instanceof Stream) {
2323
headers.append('Content-Type', 'application/octet-stream');
2424
} else if (isString(options.body)) {
2525
headers.append('Content-Type', 'text/plain');

src/templates/core/node/getRequestBody.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ function getRequestBody(options: ApiRequestOptions): BodyInit | undefined {
33
return getFormData(options.formData) as BodyInit;
44
}
55
if (options.body) {
6-
if (isString(options.body) || isBinary(options.body) || options.body instanceof Stream)) {
6+
if (isString(options.body) || isBinary(options.body) || options.body instanceof Stream) {
77
return options.body as BodyInit;
88
} else {
99
return JSON.stringify(options.body);

0 commit comments

Comments
 (0)