diff --git a/FAQ.md b/FAQ.md index 743e616..e3b281d 100644 --- a/FAQ.md +++ b/FAQ.md @@ -47,7 +47,7 @@ http.createServer(function(req, res) { pg.query(..., function(err, result) { //NOTE: error handling not present var json = JSON.stringify(result.rows); - res.writeHead(200, {'content-type':'application/json', 'content-length':json.length}); + res.writeHead(200, {'content-type':'application/json', 'content-length':Buffer.byteLength(json)}); res.end(json); }); })