strix/strix
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
..
agents Strip model-aware branches from LLM configuration 2026-06-07 17:36:19 -07:00
config Support large target repos with with bind-mount option. (#577) 2026-06-22 12:41:42 -04:00
core fix: stop gracefully with resume hint on persistent RateLimitError (#261) (#593) 2026-06-29 07:31:54 -07:00
interface Remove collection of unhandled exception error messages from telemetry (#585) 2026-06-29 19:22:06 -07:00
report Add configurable token / cost usage limits (#576) 2026-06-22 11:17:08 -04:00
runtime Support large target repos with with bind-mount option. (#577) 2026-06-22 12:41:42 -04:00
skills Merge origin/main into harness-migration 2026-05-26 14:30:30 -07:00
telemetry Remove collection of unhandled exception error messages from telemetry (#585) 2026-06-29 19:22:06 -07:00
tools resolve(proxy): recompute Content-Length when repeat_request replaces body 2026-07-01 19:39:27 +05:30
utils fix(agent): fix tool schemas not retrieved on pyinstaller binary and validate tool call args 2026-01-14 10:57:32 -08:00
__init__.py Open-source release for Alpha version 2025-08-08 20:36:44 -07:00