From d0a58a54ed63404f7e2532df8c046365edd57481 Mon Sep 17 00:00:00 2001 From: mgechev Date: Sun, 10 Jul 2016 17:40:49 +0300 Subject: [PATCH] fix(AppShell): handle case when there is whitespace in the resource mime type --- .../node-visitor/resource-inline/resource-inline-visitor.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app-shell/src/app/shell-parser/node-visitor/resource-inline/resource-inline-visitor.ts b/app-shell/src/app/shell-parser/node-visitor/resource-inline/resource-inline-visitor.ts index fd0e1ce..d5f3f41 100644 --- a/app-shell/src/app/shell-parser/node-visitor/resource-inline/resource-inline-visitor.ts +++ b/app-shell/src/app/shell-parser/node-visitor/resource-inline/resource-inline-visitor.ts @@ -40,7 +40,8 @@ export abstract class ResourceInlineVisitor extends NodeVisitor { return response.arrayBuffer() .then((arr: ArrayBuffer) => [ btoa(String.fromCharCode.apply(null, new Uint8Array(arr))), - response.headers.get('content-type') + // Can contain whitespace: 'image/jpg; charset=utf-8' + response.headers.get('content-type').replace(/\s/g, '') ]); } else { return null;