Skip to content

Conversation

@JamesNK
Copy link
Member

@JamesNK JamesNK commented Aug 4, 2025

Fixes #2593

Copy link

Copilot AI left a 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 GetHeaderValue method from GrpcProtocolHelpers to HttpRequestHelpers for 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 HttpResponseMessage through 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

@JamesNK JamesNK force-pushed the jamesnk/grpcweb-compressed-trailers branch from d688830 to 7ed4c72 Compare August 4, 2025 02:15
@JamesNK JamesNK merged commit fc1f6db into grpc:master Aug 5, 2025
4 of 5 checks passed
This was referenced Dec 19, 2025
This was referenced Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

grpc-web: trailers message is not being decompressed when compressed bit is set

3 participants