client-common icon indicating copy to clipboard operation
client-common copied to clipboard

Redirect Plugin - `max` option

Open supun-io opened this issue 4 months ago • 3 comments

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.

supun-io avatar Oct 21 '24 04:10 supun-io