datasette-referrer-policy 0.1 发布datasette-referrer-policy 0.1
Datasette 团队发布了 datasette-referrer-policy 插件版本 0.1,用于解决全球电厂演示站点中 OpenStreetMap 瓦片显示异常的问题。该问题由两个 bug 导致:一是之前添加的 CAPTCHA 功能与地图服务产生了冲突;二是 referrer policy 设置不当导致跨域请求被阻止。新版本通过调整 referrer 策略解决了地图瓦片加载问题,同时保持了原有的安全防护机制。
Simon Willison
The OpenStreetMap tiles on the Datasette global-power-plants demo weren't displaying correctly. This turned out to be caused by two bugs.
The first is that the CAPTCHA I added to that site a few weeks ago was triggering for the .json fetch requests used by the map plugin, and since those weren't HTML the user was not being asked to solve them. Here's the fix.
The second was that OpenStreetMap quite reasonably block tile requests from sites that use a Referrer-Policy: no-referrer header.
Datasette does this by default, and I didn't want to change that default on people without warning - so I had Codex + GPT-5.5 build me a new plugin to help set that header to another value.
需要完整排版与评论请前往来源站点阅读。