You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering the same issue as described in issue #686. By setting Client.MaxResponseBodySize, it returns ErrBodyTooLarge when the response body length exceeds this value.
However, I would still like to read part of the response body instead of receiving an error, and also prevent potential DOS attacks caused by large responses.
Would it be possible to provide a configuration similar to client.MaxResponseBody*Read*Size? This would be similar to what's implemented in retryablehttp-go.
Thanks!
The text was updated successfully, but these errors were encountered:
Something like that could work but it would still have to return an error. It will leave the connection in a broken state with a partially read body. It will also fail completely if the response uses chunk encoding and the first chunk by itself is already too big. It will always exclude the last chunk as it can't read that without fitting in the max size. And there are probably other edge cases that need to be considered.
I'm afraid I don't have time to work on this, a pull request is always welcome.
Hi, thanks for the great lib.
I'm encountering the same issue as described in issue #686. By setting
Client.MaxResponseBodySize
, it returnsErrBodyTooLarge
when the response body length exceeds this value.However, I would still like to read part of the response body instead of receiving an error, and also prevent potential DOS attacks caused by large responses.
Would it be possible to provide a configuration similar to
client.MaxResponseBody*Read*Size
? This would be similar to what's implemented in retryablehttp-go.Thanks!
The text was updated successfully, but these errors were encountered: