Skip to content

Fix gRPC communication with gzip compression for empty responses in .NET 9+  #5435

@qodo-code-review

Description

@qodo-code-review

Description

  • .NET 9+ GZipStream produces 0 bytes for empty responses, breaking gRPC communication when gzip compression is enabled
  • Standard GZipStream does not write valid gzip header/footer for empty content, causing decompression failures
  • Custom compression provider needed to handle edge case of empty response bodies

Deliverables

  • Custom Provider: Implement GzipCompressionProvider with EmptyContentHandlingGzipStream that writes RFC 1952 compliant gzip format for empty content
  • Test Coverage: Add comprehensive unit tests validating empty content handling on Dispose/Flush and non-empty round-trip compression
  • Integration: Update gRPC compression configuration in API and cluster startup to use custom provider instead of default implementation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions