diff --git a/package.json b/package.json index 046bf3f..e9d1adf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flummpress", - "version": "2.0.6", + "version": "2.0.7", "description": "Express für arme", "main": "src/index.mjs", "repository": { diff --git a/src/index.mjs b/src/index.mjs index 9403222..aabecdc 100644 --- a/src/index.mjs +++ b/src/index.mjs @@ -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;