Iconem / search-satellite-imagery

Search satellite Imagery Archive on aggregators like UP42, skywatch, EOS via their respective APIs
http://search-eo-imagery.iconem.com/
MIT License
44 stars 2 forks source link

Check CORS error on tiles fetch #12

Open jo-chemla opened 1 year ago

jo-chemla commented 1 year ago

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
    };
  }
}