Skip to content

Commit a4a9fef

Browse files
committed
Update Response Body
Add octet-stream too.
1 parent 9a12602 commit a4a9fef

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/templates/core/fetch/getResponseBody.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ async function getResponseBody(response: Response): Promise<any> {
55
const isJSON = contentType.toLowerCase().startsWith('application/json');
66
const isBlob = contentType.toLowerCase().startsWith('image/')
77
|| contentType.toLowerCase().startsWith('application/pdf')
8-
|| contentType.toLowerCase().startsWith('application/zip');
9-
if (isJSON) {
8+
|| contentType.toLowerCase().startsWith('application/zip')
9+
|| contentType.toLowerCase().startsWith('application/octet-stream'); if (isJSON) {
1010
return await response.json();
1111
} else if (isBlob) {
1212
return await response.blob();

src/templates/core/node/getResponseBody.hbs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ async function getResponseBody(response: Response): Promise<any> {
55
const isJSON = contentType.toLowerCase().startsWith('application/json');
66
const isBlob = contentType.toLowerCase().startsWith('image/')
77
|| contentType.toLowerCase().startsWith('application/pdf')
8-
|| contentType.toLowerCase().startsWith('application/zip');
8+
|| contentType.toLowerCase().startsWith('application/zip')
9+
|| contentType.toLowerCase().startsWith('application/octet-stream');
910
if (isJSON) {
1011
return await response.json();
1112
} else if (isBlob) {

0 commit comments

Comments
 (0)