Skip to content
Discussion options

You must be logged in to vote

The type cast shouldn't be necessary - the https.rejectUnauthorized option is fully supported in Got's types. You can just use:

await got.get(`${myendpoint}`, {
	https: {
		rejectUnauthorized: false
	},
	responseType: 'json'
})

For handling dev vs production, you could set this option conditionally based on an enviroment variable like NODE_ENV, so you don't have to worry about it accidently being set in production.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sindresorhus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants