What is CORS?
CORS (Cross-Origin Resource Sharing) is a security feature implemented in web browsers that restricts web pages from making requests to a different domain than the one that served the original page. This is a security feature to prevent malicious websites from making requests to other websites on your behalf. You can learn more from wikipedia.Why is this Required?
PMTiles requests are made over http(s) to leverage range requests. Range requests are the basis of the magic that makes reading tiles directly from a PMTiles archive fast without having a dedicated tile server. Since these requests are over http(s) and not directly via the S3 api (ie through an aws sdk) CORS comes into play. This is not specific to PMTiles. The bucket’s CORS policy applies any time the browser loads data from your bucket by URL, which is how Wherobots Cloud renders:- Wherobots-GL maps in notebooks, which take the URL of a layer written to your bucket.
- PMTiles archives opened in the hosted viewer at tile-viewer.wherobots.com.
- Any other Wherobots Cloud map that reads data straight out of object storage.

