fix: forgejo CORS

This commit is contained in:
ZhenShuo Leo
2025-07-29 04:46:55 +08:00
parent ec912c4a92
commit c3f6f901a5
+7 -1
View File
@@ -4,6 +4,12 @@
const repoId = script?.getAttribute("data-repo-id"); const repoId = script?.getAttribute("data-repo-id");
if (!repoURL || !repoId) return; if (!repoURL || !repoId) return;
if (repoId.startsWith("forgejo")) {
console.log(
"fetch-repo.js: Forgejo server blocks cross-origin requests. Live JavaScript updates are not supported.",
);
return;
}
const platforms = { const platforms = {
github: { github: {
@@ -52,6 +58,6 @@
if (element) element.innerHTML = data[dataField]; if (element) element.innerHTML = data[dataField];
}); });
} catch (error) { } catch (error) {
console.error(error); console.error(`fetch-repo.js: ${error}`);
} }
})(); })();