-
Notifications
You must be signed in to change notification settings - Fork 819
Support reading compressed grpc-web trailing headers #2650
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
Support reading compressed grpc-web trailing headers #2650
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for reading compressed grpc-web trailing headers, fixing issue #2593. The implementation enables decompression of gRPC-Web trailers that are compressed using gzip or deflate encoding.
- Moved the
GetHeaderValuemethod fromGrpcProtocolHelperstoHttpRequestHelpersfor shared usage - Added compression support for gRPC-Web trailing headers by detecting compressed trailers and decompressing them using appropriate codecs
- Updated constructor signatures to pass
HttpResponseMessagethrough the call chain to access compression headers
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Grpc.Net.Client.Web/Internal/GrpcWebResponseStream.cs | Added compressed trailer detection and decompression logic |
| src/Grpc.Net.Client.Web/Internal/CompressionHelpers.cs | New helper class for compression/decompression operations |
| src/Grpc.Net.Client.Web/Internal/GrpcWebResponseContent.cs | Updated constructor to pass HttpResponseMessage |
| src/Grpc.Net.Client.Web/GrpcWebHandler.cs | Updated to pass response message to content wrapper |
| src/Shared/HttpRequestHelpers.cs | Moved GetHeaderValue method from GrpcProtocolHelpers |
| src/Grpc.Net.Client/Internal/GrpcProtocolHelpers.cs | Removed GetHeaderValue method and updated references |
| src/Grpc.Net.Common/Compression/DeflateCompressionProvider.cs | Added leaveOpen parameter to prevent stream disposal |
| test/Grpc.Net.Client.Web.Tests/GrpcWebResponseStreamTests.cs | Added test for compressed trailers functionality |
d688830 to
7ed4c72
Compare
Fixes #2593