phin
phin copied to clipboard
Exception when requesting a compressed stream
It appears, when stream: true and compression: true, centra delivers a gzip stream which does no contain a headers
property, causing an exception in phin.js at res.headers.hasOwnProperty('location')
const phin = require("phin");
phin({
url: "https://github.com/",
stream: true,
compression: true,
}).then(function(resp){
console.log(resp);
}).catch(function(err){
console.log(err.stack);
});
TypeError: Cannot read properties of undefined (reading 'hasOwnProperty')
at phin (.../node_modules/phin/lib/phin.js:60:18)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)