Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle calling Contents on massive files (#6772)
* fix: handle calling Contents on massive files We have a message size limit enforced by the gRPC connection - however, we then go to host a HTTP server on that connection, and we weren't performing any restrictions on the size of the `Write`s. To resolve this, for any `Write` that is larger than (an adjusted for headers) size limit, we split it into multiple `Write` calls which will split it into several `BytesMessage`s by the `grpchijack` package. Note: no such transformation is required for `Read`s, since go permits short-reads, but does not permit short-writes (so `grpchijack` can return under the requested number of bytes). Arguably, this should be implemented upstream, however, it's tricky. Currently, the only upstream use of `grpchijack` is to host the session, which performs it's own message shortening procedures, which seems very fair - this patch just creates our own similar generic implementation for HTTP serving. Signed-off-by: Justin Chadwell <me@jedevc.com> * chore: add changelog Signed-off-by: Justin Chadwell <me@jedevc.com> --------- Signed-off-by: Justin Chadwell <me@jedevc.com>
- Loading branch information