bring in line with node.js
fix request header readout
update test