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

Avoid reading all from bytes.Reader when get request body #197

Merged
merged 2 commits into from
May 9, 2024

Conversation

longshine
Copy link
Contributor

Avoid reading all bytes from bytes.Reader to save memory.

See also Request.NewRequestWithContext() in net/http.

Ref: https://github.com/golang/go/blob/e71b61180aa19a60c23b3b7e3f6586726ebe4fd1/src/net/http/request.go#L881-L887

@longshine longshine requested review from a team, smacfarlane and jeanneryan and removed request for a team May 19, 2023 08:58
@hashicorp-cla
Copy link

hashicorp-cla commented May 19, 2023

CLA assistant check
All committers have signed the CLA.

@longshine longshine requested a review from a team as a code owner May 9, 2024 14:02
Copy link
Contributor

@manicminer manicminer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this improvement @longshine, this LGTM 👍

@manicminer manicminer added this to the v0.7.6 milestone May 9, 2024
@manicminer manicminer merged commit 8db2bb6 into hashicorp:main May 9, 2024
1 check passed
manicminer added a commit that referenced this pull request May 9, 2024
manicminer added a commit that referenced this pull request May 9, 2024
@longshine longshine deleted the avoid-read-from-bytes-reader branch May 10, 2024 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants