Nodejs returned arraybuffer to the client.

  node.js, question

I wanted to return arraybuffer to the client through node, but I encountered a problem:

server.js:

res.write(new Buffer([0,1,2]));
 res.writeHead(200,{'Access-Control-Allow-Origin':'*','Access-Control-Allow-Method':'GET,POST','Content-Type':'application/octet-stream'});
 res.end();

Client code:

var xhr = new XMLHttpRequest();
 xhr.responseType = "arraybuffer";
 xhr.open("post","http://localhost:8008/");
 xhr.onload = function(data){
 if(xhr.status === 200){
 console.log('succuess');
 var blo = new Blob(this.response);
 var reader = new FileReader();
 reader.readAsBinaryString(blo);
 reader.onload = function(f){
 console.log(this.result);
 bracket
 bracket
 bracket

However, the chrome console did not print the results, but output an error:

POST http://localhost:8008/ net::ERR_INVALID_CHUNKED_ENCODING

Excuse me, what is going on here? Thank you aaa

JS has poor compatibility with ArrayBuffer.
You rewrite it asxhr.responseType = "blob";Try it.
This is not guaranteed to be effective.