Skip to content
This repository was archived by the owner on Oct 12, 2021. It is now read-only.

Commit 7f8825f

Browse files
mgechevjeffbcross
authored andcommitted
fix(AppShell): handle case when there is whitespace in the resource mime type (#83)
1 parent e0775d4 commit 7f8825f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app-shell/src/app/shell-parser/node-visitor/resource-inline/resource-inline-visitor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ export abstract class ResourceInlineVisitor extends NodeVisitor {
4040
return response.arrayBuffer()
4141
.then((arr: ArrayBuffer) => [
4242
btoa(String.fromCharCode.apply(null, new Uint8Array(arr))),
43-
response.headers.get('content-type')
43+
// Can contain whitespace: 'image/jpg; charset=utf-8'
44+
response.headers.get('content-type').replace(/\s/g, '')
4445
]);
4546
} else {
4647
return null;

0 commit comments

Comments
 (0)