Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does NodeJS's https module follow redirects?

I'm using the NodeJS https module to fetch pages and process them during testing. I can't find any mention of following redirects either there or in the http module documentation.

From experience I would assume that an https.request does not automatically follow redirects (through response.headers.Location), but I'd like to be sure.

like image 217
Raketenolli Avatar asked Oct 15 '25 04:10

Raketenolli


1 Answers

Nodejs doesn't follow redirects by default.

The following article explains this http://syskall.com/how-to-follow-http-redirects-in-node-dot-js/

like image 147
itwolfpower Avatar answered Oct 17 '25 17:10

itwolfpower



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!