feat(data-collection): Request data collection - #3030
Conversation
84ceec2 to
e36c648
Compare
ceb85b7 to
6a366a2
Compare
f50f49d to
5543891
Compare
134f992 to
a3638b2
Compare
a3638b2 to
1202c30
Compare
1202c30 to
e12f4a2
Compare
a207aae to
831da33
Compare
f1e317b to
b6161d4
Compare
b6161d4 to
612525c
Compare
612525c to
bdfab90
Compare
4d4eaa4 to
bdfab90
Compare
bdfab90 to
73fb5ec
Compare
73fb5ec to
de296be
Compare
20ce2fc to
a1c0420
Compare
a1c0420 to
fdef33c
Compare
Co-Authored-By: OpenAI <noreply@example.com>
fdef33c to
dacba84
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit dacba84. Configure here.
| response: KeyValueCollection.new(mode: :deny_list, terms: nil) | ||
| ) | ||
| @http_bodies = nil | ||
| @http_bodies = BODY_TYPES |
There was a problem hiding this comment.
Frozen default http_bodies array
Medium Severity
@http_bodies is assigned the frozen BODY_TYPES constant directly. In-place updates such as << or delete raise FrozenError. Elsewhere this codebase already uses .dup for frozen defaults like DEFAULT_PATCHES.
Reviewed by Cursor Bugbot for commit dacba84. Configure here.
| return "Skipped non-rewindable request body" unless request.body.respond_to?(:rewind) | ||
|
|
||
| if request.form_data? | ||
| request.POST |
There was a problem hiding this comment.
Truncated JSON becomes parse error
Medium Severity
JSON bodies are read only up to MAX_BODY_LIMIT and then parsed. Oversized bodies are truncated mid-document, parsing fails, and the captured data becomes the parser error message instead of any request content.
Reviewed by Cursor Bugbot for commit dacba84. Configure here.
| expect(data_collection.http_headers.request.mode).to eq(:deny_list) | ||
| expect(data_collection.http_headers.request.terms).to eq(described_class::PII_HEADER_SNIPPETS) | ||
| expect(data_collection.http_headers.response.mode).to eq(:deny_list) | ||
| expect(data_collection.http_headers.request.terms).to eq(described_class::PII_HEADER_SNIPPETS) |
There was a problem hiding this comment.
Spec checks wrong header terms
Low Severity
These examples assert http_headers.request.terms twice and never verify http_headers.response.terms, so a regression in the response-header backfill or defaults would not be caught.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit dacba84. Configure here.


PII_HEADER_SNIPPETSto backfilldata_collection.http_headers.requestfor ip address collection (bothenvandrequest)data_collection.cookiesfor cookie collection (fixHashsignature since it always was one)data_collection.url_query_paramsfor query string and parse query intoHashand filterdata_collection.http_bodiesfor bodyrack_env_whitelist, will be removed in majorIssues
data_collection#3003