Skip to content

BatchConfig is missing max_body_size, so the memory bound is unreachable from the batch API #93

Description

@liquidsec

Problem

BatchConfig has no max_body_size field and no kwarg, and into_request_config hardcodes max_body_size: None at src/python.rs:1543. So BatchConfig(url, max_body_size=1024) raises TypeError, and every batch response is pinned at the 10 MB default.

README:248 lists max_body_size as a request parameter and README:253 says "BatchConfig accepts the same parameters (pass them as constructor kwargs)", so it is documented as working.

The gap predates 0.10.0, but 0.10.0 is what turned max_body_size into the bound on how much a hostile target can make the client read and allocate, and the batch API is the scanning surface where that matters most. Same shape as the alpn_protocols gap closed in #88.

Proposed Solution

Add max_body_size: Option<usize> to BatchConfig as a constructor kwarg and thread it through into_request_config, matching how RequestConfig already handles it.

Found by @en0f while reviewing #86.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions