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 }) }) })