Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Allow for request bodies larger than 32768 bytes. #448

Merged
merged 1 commit into from
Aug 11, 2020

Conversation

manugarg
Copy link
Contributor

Currently request body reader returns io.EOF on the first "Read" itself. Default HTTP transport seems to use a byte slice of size 32768, which results in request body being truncated to 32768 bytes.

This change fixes that problem by using a buffered reader if request body is larger than a certain threshold (set to bytes.MinRead, same as used by ioutil.ReadAll).

PiperOrigin-RevId: 325915715

Currently request body reader returns io.EOF on the first "Read" itself. Default HTTP transport seems to use a byte slice of size 32768, which results in request body being truncated to 32768 bytes.

This change fixes that problem by using a buffered reader if request body is larger than a certain threshold (set to bytes.MinRead, same as used by ioutil.ReadAll).

PiperOrigin-RevId: 325915715
@manugarg manugarg merged commit 07644a2 into master Aug 11, 2020
@manugarg manugarg added this to the v0.10.10 milestone Aug 11, 2020
@manugarg manugarg deleted the 63729A23134379909BFCA3AC3C378B48 branch August 13, 2020 18:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants