diff --git a/server/index.js b/server/index.js index e722bf6..e3c9d74 100644 --- a/server/index.js +++ b/server/index.js @@ -620,7 +620,7 @@ function readRaw(req, limit = 1024 * 1024) { req.on('data', (c) => { if (settled) return; buf += c; - if (buf.length > limit) { fail(new Error('Gövde çok büyük')); req.destroy(); } + if (Buffer.byteLength(buf, 'utf8') > limit) { fail(new Error('Gövde çok büyük')); req.destroy(); } }); req.on('end', () => { if (!settled) { settled = true; resolve(buf); } }); req.on('error', fail); @@ -635,7 +635,7 @@ function readBody(req, limit = 100 * 1024) { req.on('data', (c) => { if (settled) return; data += c; - if (data.length > limit) { fail(new Error('gövde çok büyük')); req.destroy(); } + if (Buffer.byteLength(data, 'utf8') > limit) { fail(new Error('gövde çok büyük')); req.destroy(); } }); req.on('end', () => { if (settled) return;