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

Requests are resolved with empty body #1496

Closed
2 tasks done
arcanis opened this issue Oct 10, 2020 · 2 comments
Closed
2 tasks done

Requests are resolved with empty body #1496

arcanis opened this issue Oct 10, 2020 · 2 comments

Comments

@arcanis
Copy link

arcanis commented Oct 10, 2020

Describe the bug

  • Node.js version: 14.0
  • OS & version: OSX

Ref: #1256 (comment)

Got on Node 14.0.0 returns empty bodies for all requests. After double-checking (I already did but messed the Node upgrade), it seems to work on 14.13. Still, it's an annoying behaviour for a minor release since it would make upgrading got in Yarn a BC-breaking change 🙁

Code to reproduce

The default one is enough:

const got = require('got');

(async () => {
	try {
		const response = await got('https://sindresorhus.com');
		console.log(response.body);
		//=> '<!doctype html> ...'
	} catch (error) {
		console.log(error.response.body);
		//=> 'Internal server error ...'
	}
})();

Checklist

  • I have read the documentation.
  • I have tried my code with the latest version of Node.js and Got.
@arcanis
Copy link
Author

arcanis commented Oct 10, 2020

Seems like both 14.0 and 14.1 are affected; starting from 14.2 the bug disappears

@szmarczak
Copy link
Collaborator

Duplicate of #1395 #1349 #1172

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

2 participants