Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can change the credentials from 'include' to 'omit'? #244

Open
awong1900 opened this issue Aug 12, 2021 · 0 comments
Open

Can change the credentials from 'include' to 'omit'? #244

awong1900 opened this issue Aug 12, 2021 · 0 comments

Comments

@awong1900
Copy link

Hi, I have a cros error like this Reason: Credential is not supported if the CORS header ‘Access-Control-Allow-Origin’ is ‘*’.
usually, when use cdn like cloudfront, we set the ‘Access-Control-Allow-Origin’ is ‘*’. But if Credential is 'include' with Fetch API, the protocol do not support.

So i think the code here:

export function priority(url) {
  // TODO: Investigate using preload for high-priority
  // fetches. May have to sniff file-extension to provide
  // valid 'as' values. In the future, we may be able to
  // use Priority Hints here.
  //
  // As of 2018, fetch() is high-priority in Chrome
  // and medium-priority in Safari.
  return window.fetch ? fetch(url, {credentials: `include`}) : viaXHR(url);
}

to

export function priority(url) {
  // TODO: Investigate using preload for high-priority
  // fetches. May have to sniff file-extension to provide
  // valid 'as' values. In the future, we may be able to
  // use Priority Hints here.
  //
  // As of 2018, fetch() is high-priority in Chrome
  // and medium-priority in Safari.
  return window.fetch ? fetch(url, {credentials: `omit`}) : viaXHR(url);
}

What do you think with it?

@XhmikosR XhmikosR changed the title Can change the credentials from ‘include’ to 'omit'? Can change the credentials from 'include' to 'omit'? Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant