diff --git a/src/index.ts b/src/index.ts index 601ad6e..610590b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -112,11 +112,12 @@ export default class Flummpress { searchParams: url.searchParams, qs: Object.fromEntries(url.searchParams.entries()), }; + req.cookies = {}; if(req.headers.cookie) { req.headers.cookie.split("; ").forEach(cookie => { const [key, value] = cookie.split("="); - req.cookies[key] = decodeURIComponent(value); + req.cookies![key] = decodeURIComponent(value); }); } } @@ -130,7 +131,7 @@ export default class Flummpress { return new Promise((resolve, reject) => { let body = ""; - req.on("data", (chunk) => { + req.on("data", chunk => { body += chunk; });