From 32abe0a5a296bc0c4e11638774e2714f30a02695 Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Tue, 7 Apr 2026 12:42:11 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20og:image=20URL=20rewriting?= =?UTF-8?q?=20in=20proxy=20route?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace target.origin instead of target.href when rewriting meta content attributes so that the full resource path is preserved. Previously, blog post og:image URLs like /blog//image.png were collapsed to /effection/image.png, causing 404s during staticalization. --- routes/proxy-route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/proxy-route.ts b/routes/proxy-route.ts index b2cf0164..b8dea2c9 100644 --- a/routes/proxy-route.ts +++ b/routes/proxy-route.ts @@ -101,7 +101,7 @@ export function proxyRoute(options: ProxyRouteOptions): HTTPMiddleware { posixNormalize(`${base.pathname}${url}`), ); } else if (properties.content.startsWith("http")) { - properties.content = properties.content.replace(target.href, base.href.replace(/\/?$/,'/')); + properties.content = properties.content.replace(target.origin, base.href.replace(/\/?$/, '')); } } }