diff --git a/package.json b/package.json index 84b44ad..5a119a5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "page-proxy", - "version": "0.0.3", + "version": "0.0.4", "description": "", "main": "index.js", "type": "module", diff --git a/src/module/proxy/http-proxy.ts b/src/module/proxy/http-proxy.ts index 5772cad..db6908b 100644 --- a/src/module/proxy/http-proxy.ts +++ b/src/module/proxy/http-proxy.ts @@ -96,7 +96,7 @@ async function getTextFromStream(stream: Readable | IncomingMessage): Promise { const html = await getTextFromStream(stream); const newHtml = addStat(html); - const newContentLength = newHtml.length; + const newContentLength = Buffer.byteLength(newHtml); return { html: newHtml, contentLength: newContentLength }; } export const httpProxy = async (