fix: use webmentions proxy in client-side fetcher

Prevents direct calls to webmention.io API which may fail without token

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ricardo
2026-01-28 15:12:08 +01:00
parent 1f3fe00ce8
commit b20f371647

View File

@@ -1,6 +1,6 @@
/**
* Client-side webmention fetcher
* Supplements build-time cached webmentions with real-time data from webmention.io
* Supplements build-time cached webmentions with real-time data from proxy API
*/
(function () {
@@ -18,7 +18,8 @@
if (sessionStorage.getItem(cacheKey)) return;
sessionStorage.setItem(cacheKey, '1');
const apiUrl = `https://webmention.io/api/mentions.jf2?target=${encodeURIComponent(target)}&per-page=100`;
// Use server-side proxy to keep webmention.io token secure
const apiUrl = `/webmentions-api/api/mentions?target=${encodeURIComponent(target)}&per-page=100`;
fetch(apiUrl)
.then((res) => res.json())