- Spotify: drop album line, normalize ";" separators to ",", add open-in-Spotify link and live progress bar - Games: resolve missing artwork via public Discord RPC app icons with placeholder fallback; add in-site game profile modal (IGDB + Steam + ITAD: artwork, details, reviews, prices) - Proxy game data through same-origin /api/game and /api/discord-app routes, CORS-locked to https://fristy.net - Lanyard: SSR REST first paint, then live WebSocket with heartbeat, reconnect backoff and polling fallback - Localize presence UI (tr/en/de): elapsed times, dates, numbers, currency, review labels, game descriptions - Sort projects by last update, descending - Slim dark scrollbars, compact Spotify progress bar
20 lines
526 B
TypeScript
20 lines
526 B
TypeScript
import { NextResponse } from "next/server";
|
|
|
|
const ALLOWED_ORIGIN = "https://fristy.net";
|
|
|
|
export function isAllowedOrigin(request: Request): boolean {
|
|
const origin = request.headers.get("origin");
|
|
return origin === null || origin === ALLOWED_ORIGIN;
|
|
}
|
|
|
|
export function corsHeaders(): HeadersInit {
|
|
return {
|
|
"Access-Control-Allow-Origin": ALLOWED_ORIGIN,
|
|
Vary: "Origin",
|
|
};
|
|
}
|
|
|
|
export function forbidden(): NextResponse {
|
|
return NextResponse.json({ error: "Forbidden" }, { status: 403 });
|
|
}
|