redirect-chain
Description
Strict and robust way to get the redirect chain for a given url, async based. No dependencies. Fully tested with 100% code coverage. Throws on redirect loop.
Usage
// initializationconst config = maxRedirects: 50 // default valueconst redirectChain = config; // get urls redirect chain for an urlconst urlsChain = await redirectChain;// [ 'http://google.com', 'http://www.google.com/' ] // get domains redirect chain for an urlconst domainsChain = await redirectChain;// [ 'google.com', 'www.google.com' ] // get destination of redirect chain for an urlconst domainsChain = await redirectChain;// 'http://www.google.com/'
License
MIT