rproxy: the body wrappers hold only what they call (closes #431) #457

Open
clawbot wants to merge 1 commits from issue-431-body-wrapper-fields into next
pull from: issue-431-body-wrapper-fields
Collaborator

Closes #431.

requestBody and responseBody no longer hold a *request. Each holds only what its Read calls.

New fields:

  • requestBody.refuse (func(status int)), set to rq.refuse;
  • responseBody.refuse (func(status int)), set to rq.refuse;
  • responseBody.responseReceived (func()), set to rq.responseReceived;
  • responseBody.ctx (context.Context), set to rq.in.Context().

rq.in is never reassigned, so taking its context when the response body is made gives the same value as reading it on each Read.

Disclosure: responseBody.ctx carries //nolint:containedctx, since the issue asks for the context itself and the body ends with the request.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/smallwebwaf/issues/431. `requestBody` and `responseBody` no longer hold a `*request`. Each holds only what its `Read` calls. New fields: - `requestBody.refuse` (`func(status int)`), set to `rq.refuse`; - `responseBody.refuse` (`func(status int)`), set to `rq.refuse`; - `responseBody.responseReceived` (`func()`), set to `rq.responseReceived`; - `responseBody.ctx` (`context.Context`), set to `rq.in.Context()`. `rq.in` is never reassigned, so taking its context when the response body is made gives the same value as reading it on each `Read`. Disclosure: `responseBody.ctx` carries `//nolint:containedctx`, since the issue asks for the context itself and the body ends with the request. Model: opus-5-5
clawbot added the needs-review label 2026-11-19 17:43:11 +01:00
clawbot added 1 commit 2026-11-19 17:43:11 +01:00
requestBody and responseBody are read on goroutines other than the
handler's. They held the whole request; now they hold only the
functions they call and, for responseBody, the request's context.

Model: opus-5-5
clawbot self-assigned this 2026-11-19 17:43:13 +01:00
Author
Collaborator

Verdict: PASS
Head: c85c1fdddb

Neither body wrapper holds a *request any more: requestBody holds refuse, and responseBody holds refuse, responseReceived and the visitor's context, which is what #431 asks for, with behaviour unchanged.

Model: opus-5-5

Verdict: PASS Head: c85c1fdddb0a5f93b57aaa52351182863a5ca834 Neither body wrapper holds a `*request` any more: `requestBody` holds `refuse`, and `responseBody` holds `refuse`, `responseReceived` and the visitor's context, which is what https://git.eeqj.de/sneak/smallwebwaf/issues/431 asks for, with behaviour unchanged. Model: opus-5-5
Some checks are pending
check / check (push) Waiting to run
You are not authorized to merge this pull request.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-431-body-wrapper-fields:issue-431-body-wrapper-fields
git checkout issue-431-body-wrapper-fields
Sign in to join this conversation.