Tag: 损坏

有效负载字节与实际字节不同

我有一个问题,当用户发送图像数据,它保存在服务器上的损坏。 所以,我基本上有这样的设置: – api . index.js – methods . users.js (我已经删除了与问题无关的文件) 在API文件之外,有一个server.js ,每当访问api.example.com时都会启动它。 (基本上像一个VirtualHost) 话虽如此。 这是问题: ./api/index.js (问题点) // All this essentiall does is get the get the whole payload as a buffer. req.on("data", function(chunk){ // Potential problem area. req.api.payload = ((req.api.payload) ? (Buffer.concat([req.api.payload, chunk])) : (chunk)); }); req.on("end", function(){ // Check if we're on […]