From 5f653a4c9f7c76d461ee4377fb4e025771cff872 Mon Sep 17 00:00:00 2001 From: yyamashita Date: Wed, 17 Jun 2026 22:27:47 +0900 Subject: Add image proxy endpoint to avoid mixed content issues Serve external event images through /api/image?url= so HTTP image URLs from venue sites are fetched server-side and delivered over HTTPS. Validates Content-Type is image/*, blocks private IPs (SSRF), and caches responses in memory (24h TTL, 200-entry LRU). Co-Authored-By: Claude Sonnet 4.6 --- app/lib/image-proxy.ts | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 app/lib/image-proxy.ts (limited to 'app/lib') diff --git a/app/lib/image-proxy.ts b/app/lib/image-proxy.ts new file mode 100644 index 0000000..b9af3bf --- /dev/null +++ b/app/lib/image-proxy.ts @@ -0,0 +1,4 @@ +export function proxyImageUrl(url: string | null | undefined): string | null { + if (!url) return null; + return `/api/image?url=${encodeURIComponent(url)}`; +} -- cgit v1.2.3