Skip to content

Commit

Permalink
2.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
giorgiopellegrino committed Oct 29, 2024
1 parent dfb6161 commit 281255c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/prefetch.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ function viaXHR(url, hasCredentials) {

request.open('GET', url, request.withCredentials = hasCredentials);

request.setRequestHeader('Accept', '*/*');

request.onload = () => {
if (request.status === 200) {
resolve();
Expand Down Expand Up @@ -92,7 +94,7 @@ export function viaFetch(url, hasModeCors, hasCredentials, isPriority) {
//
// As of 2018, fetch() is high-priority in Chrome
// and medium-priority in Safari.
options = {};
options = {headers: {accept: '*/*'}};

Check warning

Code scanning / CodeQL

Missing variable declaration Warning

Variable options is used like a local variable, but is missing a declaration.
if (!hasModeCors) options.mode = 'no-cors';
if (hasCredentials) options.credentials = 'include';
isPriority ? options.priority = 'high' : options.priority = 'low';
Expand Down

0 comments on commit 281255c

Please sign in to comment.