We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a8690c commit 7bf9ed1Copy full SHA for 7bf9ed1
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