feat(modules): add disable-redirects http option - #273
Merged
Merged
Conversation
A module that fingerprints a redirect itself (open-redirect proofs, a Location header, a 3xx status) could not see the redirect: the executor followed 3xx to the final response before matchers ran, with no way to stop. Add an opt-in disable-redirects field that scopes an ErrUseLastResponse policy to the module's own client copy, so the shared httpx transport keeps following redirects for every other module.
pr summary3 files changed (+86 -0)
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #273 +/- ##
=======================================
Coverage ? 54.78%
=======================================
Files ? 81
Lines ? 6879
Branches ? 0
=======================================
Hits ? 3769
Misses ? 2842
Partials ? 268 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
vmfunc
approved these changes
Jul 22, 2026
vmfunc
left a comment
Owner
There was a problem hiding this comment.
shallow-copy of the client to scope CheckRedirect is exactly right, mutating the shared httpx instance would've broken redirect following for every other module in the run. body still gets closed, matchers see the 302. test covers both paths.
in.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A module that fingerprints a redirect itself (open-redirect proofs, a
Locationheader, a 3xx status) could not see it: the executor followed 3xx to the final response before matchers ran, with no opt-out.Add a
disable-redirectshttp field that scopes anErrUseLastResponsepolicy to a shallow copy of the module's client, so the shared httpx transport keeps following redirects for every other module in the run. Test drives both paths against a 302-to-landing server: followed resolves to the 200 landing (302 matcher silent), disabled stops at the 302 (matcher fires).