From 834ae8623a1bb924dc8010b4030ec26ff730a6f0 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Fri, 30 Jan 2026 20:33:39 -0800 Subject: [PATCH] fix header lengths --- src/index.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 7f6432a..ea2305b 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -127,7 +127,9 @@ export class Hype< const res = c.res.clone() const html = await res.text() const formatted = formatHTML(html) - c.res = new Response(formatted, c.res) + const headers = new Headers(c.res.headers) + headers.delete('content-length') + c.res = new Response(formatted, { status: c.res.status, headers }) }) } } @@ -150,8 +152,9 @@ export class Hype< const res = c.res.clone() const html = await res.text() const newHtml = html.replace('', ``) - - c.res = new Response(newHtml, c.res) + const headers = new Headers(c.res.headers) + headers.delete('content-length') + c.res = new Response(newHtml, { status: c.res.status, headers }) }) })