diff --git a/package.json b/package.json index 14e40cba..47f217b6 100755 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "test": "stencil test --spec" }, "devDependencies": { - "@stencil/core": "0.14.0-4", + "@stencil/core": "0.16.0-0", "@stencil/router": "0.3.0", "@stencil/sass": "0.1.1", "@types/highlight.js": "^9.12.3", diff --git a/src/components/icon/icon.tsx b/src/components/icon/icon.tsx index 6d26ca36..7b2a1f7e 100755 --- a/src/components/icon/icon.tsx +++ b/src/components/icon/icon.tsx @@ -203,7 +203,7 @@ function getSvgContent(doc: Document, url: string, scopedId: string | undefined) if (!req) { // we don't already have a request req = fetch(url, { cache: 'force-cache' }).then(rsp => { - if (rsp.ok) { + if (isStatusValid(rsp.status)) { return rsp.text(); } return Promise.resolve(null); @@ -217,6 +217,10 @@ function getSvgContent(doc: Document, url: string, scopedId: string | undefined) } +function isStatusValid(status: number) { + return status <= 299; +} + function validateContent( document: Document, svgContent: string | null,