Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Check response body size to not exceed maximum before json_decoding #52

Merged
merged 5 commits into from
Jul 8, 2024

Conversation

annajeanine
Copy link
Member

In the parseResponse method we decode the response of the request. There is no check for the size of the response before decoding which could result in a memory allocation error. In this PR I've set a default of 50mb as maximum response size. If the response exceeds this limit, an exception is thrown.
To provide flexibility for users of this package, the limit can be set when initialising the Connection.

@annajeanine annajeanine requested a review from casperbakker June 24, 2024 12:16
@annajeanine annajeanine merged commit 4a8e063 into main Jul 8, 2024
@annajeanine annajeanine deleted the handle-maximum-size-response branch July 8, 2024 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants