fix: error

This commit is contained in:
熊潇 2025-04-08 00:48:05 +08:00
parent 3b32ba7244
commit c9a3f7fda9
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "page-proxy", "name": "page-proxy",
"version": "0.0.3", "version": "0.0.4",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"type": "module", "type": "module",

View File

@ -96,7 +96,7 @@ async function getTextFromStream(stream: Readable | IncomingMessage): Promise<st
export async function getTextFromStreamAndAddStat(stream: Readable | IncomingMessage): Promise<{ html: string; contentLength: number }> { export async function getTextFromStreamAndAddStat(stream: Readable | IncomingMessage): Promise<{ html: string; contentLength: number }> {
const html = await getTextFromStream(stream); const html = await getTextFromStream(stream);
const newHtml = addStat(html); const newHtml = addStat(html);
const newContentLength = newHtml.length; const newContentLength = Buffer.byteLength(newHtml);
return { html: newHtml, contentLength: newContentLength }; return { html: newHtml, contentLength: newContentLength };
} }
export const httpProxy = async ( export const httpProxy = async (