mirror of
https://github.com/ionic-team/ionicons.git
synced 2026-11-30 16:48:16 +01:00
fix(capacitor): accept 0 as valid status code
This commit is contained in:
+1
-1
@@ -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",
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user