Unwind has a single goal. Take a url and figure out what it actually points to.
It is able to walk various redirect status codes, handles relative and absolute locations, and a couple of other gotchas.
Once completed you have the destination url and a list of the hops along the way.
1 2 3 4 | |
Hat Tip: This gem started with code from John Nunemaker’s Following Redirects with Net/HTTP which provided the basic code to get this done.