Use Buffer.byteLength to calculate content-length