Skip to content

Commit

Permalink
enhance: replaced str.startsWith with str.indexOf (#1404)
Browse files Browse the repository at this point in the history
  • Loading branch information
elasim committed Nov 10, 2023
1 parent b5cee50 commit a686358
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fetch.js
Expand Up @@ -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;
Expand Down

0 comments on commit a686358

Please sign in to comment.