There was an error while loading. Please reload this page.
2 parents 6e8bcb8 + 7bf9ed1 commit 246b7b5Copy full SHA for 246b7b5
src/templates/core/node/getResponseBody.hbs
@@ -3,8 +3,13 @@ async function getResponseBody(response: Response): Promise<any> {
3
const contentType = response.headers.get('Content-Type');
4
if (contentType) {
5
const isJSON = contentType.toLowerCase().startsWith('application/json');
6
+ const isBlob = contentType.toLowerCase().startsWith('image/')
7
+ || contentType.toLowerCase().startsWith('application/pdf')
8
+ || contentType.toLowerCase().startsWith('application/zip');
9
if (isJSON) {
- return await response.json();
10
+ return await response.json();
11
+ } else if (isBlob) {
12
+ return await response.blob();
13
} else {
14
return await response.text();
15
}
0 commit comments