feat: add bilingual guild analytics with battle filters and composition insights

This commit is contained in:
Meghdad committed 2026-10-20 15:59:30 +03:30
1 parent 4cea3709af
commit 29963fa09d
13 files changed
+730 -2

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import { proxyAlbion } from './scripts/albion-proxy.mjs';
export default {
async fetch(request, env) {
const url = new URL(request.url);
if (url.pathname.startsWith('/api/albion/')) {
// An optional separately hosted API only shares public reports with the configured site.
const origin = request.headers.get('Origin');
const allowed = !origin || origin === url.origin || origin === env.SITE_ORIGIN;
if (!allowed) return new Response('Forbidden', { status: 403 });
const response = await proxyAlbion(request);
if (origin && origin === env.SITE_ORIGIN) {
response.headers.set('Access-Control-Allow-Origin', origin);
response.headers.set('Vary', 'Origin');
}
return response;
}
return env.ASSETS.fetch(request);
},
};