Skip to content

Clear the circular redirection history of a redirect chain once it is finished - #257

Open
Amoifr wants to merge 2 commits into
php-http:2.xfrom
Amoifr:fix-256-redirect-chain-reset
Open

Amoifr wants to merge 2 commits into
php-http:2.xfrom
Amoifr:fix-256-redirect-chain-reset

Conversation

@Amoifr

@Amoifr Amoifr commented Oct 8, 2026

Copy link
Copy Markdown
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets fixes #256
License MIT

What's in this PR?

As suggested in #256, the first commit adds tests: one with a circular redirection over two hops through the real $first callable, which already passes, and two where a new chain reuses the $first instance of a finished chain (ending with a response, then with an exception). Both fail on 2.x with "Circular redirection detected".

The second commit makes the call that starts a chain remove its entry from $circularDetection in a finally, so a reused identifier starts from an empty history and finished chains no longer stay in memory. The line number of the anonymous class in phpstan.neon.dist moves from 221 to 229.

Checklist

  • Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RedirectPlugin] potential issue in loop detection with long-running processes

1 participant