client-common
client-common copied to clipboard
Redirect Plugin - `max` option
Description
Looking at the docs/code, I don't see a way to define the number of maximum redirects to follow (similar to allow_redirects.max
in Guzzle). This seems like a good security measure to have. There seems to be circulation redirects detection, but there could be a website redirecting from /1
-> /2
-> ... infinitely, causing essentially an infinite loop.
Example
new RedirectPlugin([
'max' => 3,
]);
Additional context
I'm happy to work on the PR if the idea is accepted.