Skip to content

feat(modules): add disable-redirects http option - #273

Merged
vmfunc merged 1 commit into
vmfunc:mainfrom
TBX3D:feat/module-disable-redirects
Jul 22, 2026
Merged

vmfunc merged 1 commit into
vmfunc:mainfrom
TBX3D:feat/module-disable-redirects

Conversation

@TBX3D

@TBX3D TBX3D commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

A module that fingerprints a redirect itself (open-redirect proofs, a Location header, 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-redirects http field that scopes an ErrUseLastResponse policy 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).

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.
@TBX3D
TBX3D requested a review from vmfunc as a code owner July 3, 2026 08:51
@github-actions github-actions Bot added size/m <200 lines changed modules changes to scan modules tests test changes labels Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

pr summary

3 files changed (+86 -0)

category files
go source 3
tests 1

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@7ea1cd2). Learn more about missing BASE report.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vmfunc vmfunc left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@vmfunc
vmfunc merged commit 2cfee4c into vmfunc:main Jul 22, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

modules changes to scan modules size/m <200 lines changed tests test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants