CORS for map tiles?
See original GitHub issueWe currently enable CORS only for metadata_api
, not for tile_api
or spec_api
:
However, we need CORS also for map tiles when using Mapbox GL as a client, because it fetches the data inside the web client, rather than just letting the browser load the images directly, like Leaflet does it.
What is the rationale behind not enabling CORS for all endpoints? And if we were to change that, should we just enable CORS everywhere or make it a configurable option (CORS=false
or so)?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:9
Top Results From Across the Web
Why can leafletjs use map tiles from a non-CORS server and ...
The map tiles come from another internal server named maps.local . Leaflet finds the tiles perfectly given the appropriate tile URL http:// maps...
Read more >CORS errors | Help - Mapbox docs
Learn how to address CORS errors. ... CORS (cross origin request sharing) errors can be identified by checking for error ... Blank or...
Read more >CORS problem when using self hosted tile map server - Kibana
Hi there. I'm ran a self hosted OSM tile server with this repo. map is working well and functional and accessible with leaflet...
Read more >CORS error when requesting coverage vector tiles
Requesting a tile with curl works fine but when I try to add the tiles as a Leaflet layer, I get a CORS...
Read more >Trying to use Tile overlays - Need CORS help
In creating Tile Overlay in a GEW project I received the dreaded: "Access to XMLHttpRequest at 'https://br1.nic.edu/giga/89093/89093_files/7/ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Like @dionhaefner I also think the first option is preferable, but the second one is fine too.
Config sounds good. With CORS enabled globally, anyone can hijack the Terracotta server and request tiles in the backend of their own application, which might get costly. Of course you can still hijack the server in the frontend without CORS, so the only real protection is proper authentication.