bytesize instead of length
This commit is contained in:
parent
d57951a41d
commit
7f02123115
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "flummpress",
|
"name": "flummpress",
|
||||||
"version": "2.0.6",
|
"version": "2.0.7",
|
||||||
"description": "Express für arme",
|
"description": "Express für arme",
|
||||||
"main": "src/index.mjs",
|
"main": "src/index.mjs",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import http from "http";
|
import http from "http";
|
||||||
import { URL } from "url";
|
import { URL } from "url";
|
||||||
|
import { Buffer } from "buffer";
|
||||||
import querystring from "querystring";
|
import querystring from "querystring";
|
||||||
|
|
||||||
import Router from "./router.mjs";
|
import Router from "./router.mjs";
|
||||||
|
@ -110,7 +111,7 @@ export default class flummpress {
|
||||||
}) => {
|
}) => {
|
||||||
res.writeHead(code, {
|
res.writeHead(code, {
|
||||||
"content-type": `${type}; charset=UTF-8`,
|
"content-type": `${type}; charset=UTF-8`,
|
||||||
"content-length": body.length
|
"content-length": Buffer.byteLength(body, 'utf-8')
|
||||||
});
|
});
|
||||||
if(res.method === 'HEAD')
|
if(res.method === 'HEAD')
|
||||||
body = null;
|
body = null;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user