Skip to content

feat(http): add body regex filtering#335

Open
Co-Messi wants to merge 1 commit intohengyoush:mainfrom
Co-Messi:codex/http-body-filter
Open

feat(http): add body regex filtering#335
Co-Messi wants to merge 1 commit intohengyoush:mainfrom
Co-Messi:codex/http-body-filter

Conversation

@Co-Messi
Copy link
Copy Markdown

Problem

HTTP filtering currently supports method, path, prefix, regex, and host matching, but there is no way to filter on request or response body content.

What changed

  • added a --body regex flag to the http command
  • extended protocol.HttpFilter with body regex support
  • matched the regex against the HTTP payload section after `

`

  • enabled response-side filtering when a body regex is configured
  • added HTTP filter tests for request-body matches, response-body matches, and non-matches

Why this fixes it

This keeps the new behavior inside the existing HTTP filter path, so body matching works alongside the current path/method/host filters instead of introducing a separate filtering stage.

Verification

  • GOOS=linux GOARCH=arm64 go test -c ./agent/protocol
  • parser sanity check for the new request/response body fixtures using Go's stdlib net/http

I could not run the full Go test suite on this macOS machine because the repo's Linux-only code and BPF toolchain are required for end-to-end test execution.

Fixes #263

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

@siewcapital is attempting to deploy a commit to the hengyoush's projects Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for filtering HTTP resp by body content

2 participants