返回全部资讯
Simon Willison 博客T2·开源与评测

datasette-leaflet 0.3 修复 OSM 瓦片引用策略

原标题:datasette-leaflet 0.3
38AI 研判分

Datasette 的 Leaflet 插件 datasette-leaflet 发布 0.3 版本,将瓦片请求的 Referrer-Policy 从 no-referrer 调整为 strict-origin-when-cross-origin,以符合 OpenStreetMap 对托管瓦片服务器的引用来源要求。该改动仅传递主机名而不暴露完整页面路径,属于小型兼容性修复。

报道正文

OpenStreetMap have a very reasonable policy that hits to their hosted tile server should send a referrer header. Datasette table pages used the Referrer-Policy: no-referrer HTTP header, causing plugins that loaded tiles from OpenStreetMap to violate that policy.

datasette-leaflet is the plugin that loads a bundled Leaflet so other Datasette plugins can depend on it. It now sets the referrer policy on the tile requests themselves to strict-origin-when-cross-origin, passing the host but not the full path to the page.