From a686358611c631a8846e61683eccde75c30b487b Mon Sep 17 00:00:00 2001 From: Lee JeongHo Date: Sat, 11 Nov 2023 06:32:39 +0900 Subject: [PATCH] enhance: replaced str.startsWith with str.indexOf (#1404) --- fetch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.js b/fetch.js index 5b5c5ffc..f9a9d84f 100644 --- a/fetch.js +++ b/fetch.js @@ -543,7 +543,7 @@ export function fetch(input, init) { } // This check if specifically for when a user fetches a file locally from the file system // Only if the status is out of a normal range - if (request.url.startsWith('file://') && (xhr.status < 200 || xhr.status > 599)) { + if (request.url.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) { options.status = 200; } else { options.status = xhr.status;