Skip to content

Commit abe7db1

Browse files
committed
Fix content type processing to enable pdf downloading
1 parent 0bc6115 commit abe7db1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/templates/core/fetch/getResponseBody.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ export const getResponseBody = async (response: Response): Promise<any> => {
77
const isJSON = jsonTypes.some(type => contentType.toLowerCase().startsWith(type));
88
if (isJSON) {
99
return await response.json();
10+
} else if (contentType.includes('application/pdf')) {
11+
return await response.blob();
1012
} else {
1113
return await response.text();
1214
}

0 commit comments

Comments
 (0)