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

limit the size of the logged response to 2048 bytes in error cases #376

Open
wants to merge 2 commits into
base: v3
Choose a base branch
from

Conversation

drakkan
Copy link

@drakkan drakkan commented Apr 25, 2023

Fixes #306

Maybe we should also limit the size while reading the body itself, currently we have

body, err := ioutil.ReadAll(resp.Body)

we could do instead

body, err := ioutil.ReadAll(io.LimitReader(resp.Body, 262144))

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.

Log the entire body if non-OK fills up disk quickly
1 participant