Skip to content

Commit

Permalink
Revert "enhance: replaced str.startsWith with str.indexOf (JakeChampi…
Browse files Browse the repository at this point in the history
…on#1404)"

This reverts commit a686358.
  • Loading branch information
hishamhalil committed Nov 25, 2023
1 parent af5cf4b commit 27ddcd5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fetch.js
Original file line number Diff line number Diff line change
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.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) {
if (request.url.startsWith('file://') && (xhr.status < 200 || xhr.status > 599)) {
options.status = 200;
} else {
options.status = xhr.status;
Expand Down

0 comments on commit 27ddcd5

Please sign in to comment.