Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when requesting a compressed stream #88

Open
yetzt opened this issue Jul 31, 2023 · 0 comments
Open

Exception when requesting a compressed stream #88

yetzt opened this issue Jul 31, 2023 · 0 comments

Comments

@yetzt
Copy link

yetzt commented Jul 31, 2023

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant