mirror of
https://github.com/lunchcat/sif.git
synced 2026-07-28 14:37:01 -07:00
fix(modules): read the chained-request body through the shared cap (#374)
main does not build: internal/modules/executor.go:197 references MaxBodySize, which no longer exists in this package. nobody's patch is wrong on its own. #317 added the request-chaining loop with a capped read against the const as it stood, then #355 moved the cap to internal/httpx and updated every reference that existed at the time. neither diff touched the other, so both were green in isolation and only the merged tree is broken. use httpx.ReadCappedBody, which the same file already uses at line 423 and the frameworks detector uses too.
This commit is contained in:
@@ -194,7 +194,7 @@ func executeHTTPChain(ctx context.Context, client *http.Client, target string, d
|
|||||||
// a transport error breaks the chain; return whatever matched earlier.
|
// a transport error breaks the chain; return whatever matched earlier.
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
respBody, err := io.ReadAll(io.LimitReader(resp.Body, MaxBodySize))
|
respBody, err := httpx.ReadCappedBody(resp)
|
||||||
resp.Body.Close()
|
resp.Body.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, nil
|
return result, nil
|
||||||
|
|||||||
Reference in New Issue
Block a user