Skip to content

Conversation

@aagbsn
Copy link
Contributor

@aagbsn aagbsn commented Dec 1, 2025

Checklist

Description

Adds helper LimitBodyReader to wrap http.Response.Body and limit maximum payload to 128MB; also apply this limit to the NDT7 download test

This adds a helper method that limits reading http.Response.Body to
the minimum of Content-Length or MaxPayloadSize (128MB).

Usage of netxlite.ReadAllContext and netxlite.StreamAllContext should
only be used with an io.LimitedReader in order to prevent memory
exhaustion.
Set the maximum request size to 128MB to prevent memory exhaustion.
Copy link
Contributor

@DecFox DecFox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! LGTM!

@DecFox DecFox merged commit 8fefed8 into ooni:master Dec 8, 2025
15 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants