Skip to content

[probes.http] Fix an off-by-one bug in MaxRedirect handling - #1218

Merged
manugarg merged 2 commits into
mainfrom
http_max_redirect
Feb 10, 2026
Merged

manugarg merged 2 commits into
mainfrom
http_max_redirect

Conversation

@manugarg

@manugarg manugarg commented Feb 10, 2026 •

Copy link
Copy Markdown
Contributor

After extending further the tests added in #1216, I found another bug in MaxRedirect handling. This bug is the result of via in CheckRedirect works:

  • via includes the initial request, len(via) is effectively the count of requests made so far. So we should really terminate when len(via) is greater than MaxRedirect, rather than when when it's greater than or equal to MaxRedirect.
  • This PR fixes the bug and adds more tests.

@manugarg manugarg changed the title [probes.http] Fix another bug in MaxRedirect handling [probes.http] Fix an off-by-one bug in MaxRedirect handling Feb 10, 2026
@manugarg
manugarg merged commit ba062d6 into main Feb 10, 2026
12 checks passed
@manugarg
manugarg deleted the http_max_redirect branch February 10, 2026 00:58
@manugarg manugarg added this to the v0.14.2 milestone Feb 14, 2026
conallob pushed a commit to conallob/cloudprober that referenced this pull request Mar 10, 2026
…ber#1218)

After extending further the tests added in cloudprober#1216, I found another bug in MaxRedirect handling. This bug is the result of `via` in CheckRedirect works:

- `via` includes the initial request, len(via) is effectively the count of requests made so far. So we should really terminate when len(via) is greater than MaxRedirect, rather than when when it's greater than __or equal__ to MaxRedirect.
- This PR fixes the bug and adds more tests.
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.

1 participant