Skip to content
This repository was archived by the owner on Mar 3, 2025. It is now read-only.

Commit 72d004e

Browse files
committed
make axio request understand bcs response
1 parent 12aa25e commit 72d004e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/templates/core/axios/sendRequest.hbs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ const sendRequest = async <T>(
1818
cancelToken: source.token,
1919
};
2020

21+
const isBCS = Object.keys(config.HEADERS || {})
22+
.filter((k) => k.toLowerCase() === "accept")
23+
.map((k) => (config.HEADERS as Record<string, string>)[k])
24+
.includes("application/x-bcs");
25+
if (isBCS) {
26+
requestConfig.responseType = "arraybuffer";
27+
}
28+
2129
onCancel(() => source.cancel('The user aborted a request.'));
2230

2331
try {

0 commit comments

Comments
 (0)