fix: error
This commit is contained in:
parent
3b32ba7244
commit
c9a3f7fda9
@ -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",
|
||||||
|
@ -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 (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user