strix/tests
hardik-devops f4d2aea432 resolve(proxy): recompute Content-Length when repeat_request replaces body
Problem:
apply_modifications() let modifications={"body": ...} replace the request
body but left the original Content-Length header untouched.
build_raw_request() only fills in Content-Length when the header is
absent, so the stale, smaller value from the original request was sent
on the wire alongside the new, larger body.

Impact:
A server reading exactly Content-Length bytes truncates the replayed
body (or stalls waiting for more), silently discarding the
modified/injected payload. This defeats parameter-tampering and
injection replays, which is the core use case of repeat_request, and
produces misleading negative results during testing.

Resolution:
When modifications["body"] is present, drop any existing Content-Length
header from the carried-over headers (matched case-insensitively),
unless the caller explicitly supplies Content-Length in this same call's
modifications["headers"]. This lets build_raw_request's existing
"fill in if absent" logic recompute the correct length from the new
body.

Testing:
Added tests/test_caido_api.py covering: stale header dropped on body
replacement, explicit caller-supplied Content-Length respected, headers
left untouched when body isn't modified, and an end-to-end check that
build_raw_request emits the recomputed length in the raw HTTP request.
Verified RED (failing on pre-fix code, reproducing the exact stale
Content-Length: 3 scenario from the bug report) before GREEN.

Resolves #603
2026-07-01 19:39:27 +05:30
..
__init__.py Add configurable token / cost usage limits (#576) 2026-06-22 11:17:08 -04:00
test_caido_api.py resolve(proxy): recompute Content-Length when repeat_request replaces body 2026-07-01 19:39:27 +05:30
test_config_loader.py test: add unit tests for config loader (strix/config/loader.py) (#596) 2026-06-30 04:31:29 -07:00
test_execution.py Add configurable token / cost usage limits (#576) 2026-06-22 11:17:08 -04:00
test_hooks.py Add configurable token / cost usage limits (#576) 2026-06-22 11:17:08 -04:00
test_inputs.py fix(core): collapse child agent initial input into a single user message (#589) 2026-06-29 06:51:47 -07:00
test_local_sources.py Support large target repos with with bind-mount option. (#577) 2026-06-22 12:41:42 -04:00
test_runner_rate_limit.py fix: stop gracefully with resume hint on persistent RateLimitError (#261) (#593) 2026-06-29 07:31:54 -07:00
test_session_entries.py Support large target repos with with bind-mount option. (#577) 2026-06-22 12:41:42 -04:00