Skip to content

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

Open
drakkan wants to merge 2 commits into
coreos:v3from
drakkan:limitbody
Open

limit the size of the logged response to 2048 bytes in error cases#376
drakkan wants to merge 2 commits into
coreos:v3from
drakkan:limitbody

Conversation

@drakkan
Copy link
Copy Markdown

@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