bytesize instead of length
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import http from "http";
|
||||
import { URL } from "url";
|
||||
import { Buffer } from "buffer";
|
||||
import querystring from "querystring";
|
||||
|
||||
import Router from "./router.mjs";
|
||||
@ -110,7 +111,7 @@ export default class flummpress {
|
||||
}) => {
|
||||
res.writeHead(code, {
|
||||
"content-type": `${type}; charset=UTF-8`,
|
||||
"content-length": body.length
|
||||
"content-length": Buffer.byteLength(body, 'utf-8')
|
||||
});
|
||||
if(res.method === 'HEAD')
|
||||
body = null;
|
||||
|
Reference in New Issue
Block a user