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

Check CORS error on tiles fetch #12

Open
jo-chemla opened this issue Aug 2, 2023 · 0 comments
Open

Check CORS error on tiles fetch #12

jo-chemla opened this issue Aug 2, 2023 · 0 comments

Comments

@jo-chemla
Copy link
Contributor

Can be modified via the transformRequest function, eg on this link

Goal is to remove the need for an Allow-CORS plugin.

Code-sample from the doc:

// Use `transformRequest` to modify requests that begin with `http://myHost`.
transformRequest: (url, resourceType) => {
  if (resourceType === 'Source' && url.startsWith('http://myHost')) {
    return {
      url: url.replace('http', 'https'),
      headers: {'my-custom-header': true},
      credentials: 'include'  // Include cookies for cross-origin requests
    };
  }
}
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