News ·
datasette-leaflet 0.3
datasette-leaflet 0.3 fixes OpenStreetMap tile requests by setting a referrer policy that complies with OSM's requirement for a referrer header.
Datasette's datasette-leaflet plugin, which bundles the Leaflet JavaScript library for other Datasette plugins to depend on, has been updated to version 0.3. The change addresses a conflict with OpenStreetMap's policy for its hosted tile server.
OpenStreetMap requires that hits to its tile server send a referrer header. Datasette table pages previously sent the Referrer-Policy: no-referrer HTTP header, which meant plugins loading OpenStreetMap tiles violated that policy. The plugin now sets the referrer policy on tile requests themselves to strict-origin-when-cross-origin, passing the host but not the full path of the page.
If you build maps into Datasette instances or similar data apps using shared tile servers, provider policies like this can break your tiles quietly. Per-request referrer policies let you satisfy a provider's terms without weakening privacy settings across the whole page.
References
- Simon Willison · simonwillison.net
Read the full story at Simon Willison ↗Like, save or discuss on Buzz


