summaryrefslogtreecommitdiff
path: root/app/components/EventCard.tsx
diff options
context:
space:
mode:
authoryyamashita <yyamashita@hetzner.yyamashita.com>2026-06-17 22:27:47 +0900
committeryyamashita <yyamashita@hetzner.yyamashita.com>2026-06-17 22:27:47 +0900
commit5f653a4c9f7c76d461ee4377fb4e025771cff872 (patch)
tree4cb8e8ee191bc082a69c10b99c717df948c01cca /app/components/EventCard.tsx
parentb323ad4824cc62cf54a9bfa4f9f68dda4b783323 (diff)
Add image proxy endpoint to avoid mixed content issues
Serve external event images through /api/image?url=<encoded> 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 <noreply@anthropic.com>
Diffstat (limited to 'app/components/EventCard.tsx')
-rw-r--r--app/components/EventCard.tsx3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/components/EventCard.tsx b/app/components/EventCard.tsx
index 6651ff9..b23742d 100644
--- a/app/components/EventCard.tsx
+++ b/app/components/EventCard.tsx
@@ -1,5 +1,6 @@
import { Link } from "react-router";
import type { Event } from "~/lib/db.server";
+import { proxyImageUrl } from "~/lib/image-proxy";
interface Props {
event: Event;
@@ -16,7 +17,7 @@ export default function EventCard({ event }: Props) {
>
{event.image_url ? (
<img
- src={event.image_url}
+ src={proxyImageUrl(event.image_url)!}
alt={event.title}
className="h-36 w-full object-cover"
/>