Open skalee opened 6 years ago
Agree. Not sure if we want to allow 301/302 independently or require the redirected result to be retrievable? Maybe we can allow the user to specify what status codes are acceptable (2xx, 3xx, 4xx)?
IMHO the latter, we should follow redirections (up to about 10 hops) and ensure that redirections chain ends with some 2xx response.
There is a possible issue if someone enters a never ending redirection, then it would max out the hops and use up considerable resources...
Maybe the user can specify an accepted end status, such as if "acceptable: [300..399]" is acceptable we don't even check the redirection. But if user configures "follow_redirects: 5" then we go with 5 hops max until we hit an acceptable state or reach max hops?
In case of HTTP 301 or 302, the validator should perform another request to ensure that location pointed out in the redirection response is indeed retrievable.