From 160788780b18d45d8db1e51a5616180c69884945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Mon, 31 Aug 2026 02:10:58 +0100 Subject: [PATCH] the dev proxy did not rewrite srcset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Responsive images 404'd in every preview, and did it silently. The attribute rule matches a whole attribute value, so it could never have handled srcset — that is a comma-separated LIST of "url descriptor" pairs, and prefixing it as one value would mangle the first descriptor onto the first URL. It did not match srcset at all. Silently is the operative word. An with a srcset also has a src, and the src WAS prefixed — but a browser given a valid srcset chooses from it and never looks at src. So the markup read correctly, one attribute pointed at the platform root, and the image was just missing. Found by a logo that would not load in the fofos layout preview. imagesrcset is rewritten too. That is the one on , easy to miss and expensive to miss: a preload that 404s costs a request and leaves the real image undiscovered until the body is parsed, which is the opposite of why anybody adds one. Six tests, including the case that found it — src prefixed, srcset not, image missing — and a protocol-relative candidate left alone, which is the rule everywhere else in this file. Co-Authored-By: Claude Opus 5 (1M context) --- .../api/dev-proxy/html-rewrite.test.ts | 37 ++++++++++++++++ src/servers/api/dev-proxy/html-rewrite.ts | 44 ++++++++++++++++++- 2 files changed, 80 insertions(+), 1 deletion(-) diff --git a/src/servers/api/dev-proxy/html-rewrite.test.ts b/src/servers/api/dev-proxy/html-rewrite.test.ts index 4d255e19..40865792 100644 --- a/src/servers/api/dev-proxy/html-rewrite.test.ts +++ b/src/servers/api/dev-proxy/html-rewrite.test.ts @@ -58,6 +58,43 @@ describe('rewriteHtml', () => { expect(out.indexOf('