yarpc / yarpc-go

A message passing platform for Go
MIT License
401 stars 101 forks source link

grpc outbound to return read-only body #2233

Closed saurabhagrawal-86 closed 7 months ago

saurabhagrawal-86 commented 7 months ago

If the response body returned by grpc transport is a bytes.Buffer object, callers can use its Write methods to modify its contents. This is not desirable.

This PR fixes it by returning a bytes.Reader instead of a bytes.Buffer, making the returned response body read-only.

rabbbit commented 7 months ago

At a risk of being PITA, could you please update:

Description and context for reviewers: one partner, one stranger Docs (package doc) Entry in CHANGELOG.md