diff --git a/package.json b/package.json index 2ad441e..e1faf9d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@otakustay/bce-sdk", - "version": "0.12.8", + "version": "0.12.9", "description": "Yet another Baidu Cloud SDK", "type": "module", "exports": { diff --git a/src/shared/http.ts b/src/shared/http.ts index f8f25ed..e7fb750 100644 --- a/src/shared/http.ts +++ b/src/shared/http.ts @@ -149,13 +149,16 @@ export class Http { {timestamp} ); + const requestInit = { + method, + headers, + body: isPlainObject(options?.body) ? JSON.stringify(options?.body) : (options?.body ?? null), + duplex: 'half', + }; + const response = await fetch( this.baseUrl + url + (searchParams ? `?${searchParams}` : ''), - { - method, - headers, - body: isPlainObject(options?.body) ? JSON.stringify(options?.body) : (options?.body ?? null), - } + requestInit, ); const responseHeaders = entriesToRecord([...response.headers.entries()]);