followRedirect
option
This option disables following redirects and got
will not treat them as errors:
const res = await got(`google.com`, {followRedirect: false});
res.statusCode === 302; // true
By default this option is true
, so no major changes in code are needed.