demo: index.js: fix Content-Length bug by converting entity to Buffer