mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
content-length header should be byte length, not character length.
parent
35ac068ab4
commit
e29dddb014
2
FAQ.md
2
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);
|
||||
});
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user