cavaliergopher / grab

A download manager package for Go
BSD 3-Clause "New" or "Revised" License
1.38k stars 151 forks source link

Should follow 302 responses #25

Closed wagoodman closed 6 years ago

wagoodman commented 6 years ago

It looks like one of your latest releases removed the ability to follow a redirect (https://github.com/cavaliercoder/grab/commit/15e13149d17d2487c261c6fb9521b522d2040fee), unless you specify req.IgnoreBadStatusCodes = true. If this was an intentional update, then you can close this issue. Otherwise if you change the upper bound on this line to 399 we're good!

cavaliercoder commented 6 years ago

Thanks for raising this. It's definitely not my intention to break redirects - however, my expectation is that the stdlib will handle the redirect and pass the post-redirect response to grab for evaluation. In that sense, grab should never see the 30X response and reject it. I've confirmed that the recent update behaves this way in some exploratory testing. Can you please provide any example URL where this might be an issue for you?

wagoodman commented 6 years ago

Interesting, I wasn't able to reproduce it. I hadn't committed the exact code I ran to get this issue... sorry about that. If I run across the issue again I'll re-post, but for the meantime I'll close this issue. However, I did reproduce issue #20, I'll follow up in that ticket

cavaliercoder commented 6 years ago

Thanks for the feedback!