When serving tiles, it's sometimes useful to whitelist CORS "access" from more than one domain (but not from everywhere). It would be helpful for me if this was possible with pmtiles.
Since response header Access-Control-Allow-Origin only allows to specify one domain name, I think the server code could check Origin header from request, and if it would be one of the whitelisted origins, it would copy it to Access-Control-Allow-Origin in response.
The whitelisted CORS origins could be listed in the --cors argument, just comma-separated. For example:
pmtiles serve ./ --cors="https://mydomain.com,https://otherdomain.com"
I could contribute this. Would you be interested in taking it in?
When serving tiles, it's sometimes useful to whitelist CORS "access" from more than one domain (but not from everywhere). It would be helpful for me if this was possible with pmtiles.
Since response header
Access-Control-Allow-Originonly allows to specify one domain name, I think the server code could checkOriginheader from request, and if it would be one of the whitelisted origins, it would copy it toAccess-Control-Allow-Originin response.The whitelisted CORS origins could be listed in the
--corsargument, just comma-separated. For example:pmtiles serve ./ --cors="https://mydomain.com,https://otherdomain.com"I could contribute this. Would you be interested in taking it in?