]> git.feebdaed.xyz Git - 0xmirror/grpc-go.git/commit
encoding: Add a test-only function for temporarily registering compressors (#8587)
authorArjan Singh Bal <46515553+arjan-bal@users.noreply.github.com>
Mon, 22 Sep 2025 19:29:26 +0000 (00:59 +0530)
committerGitHub <noreply@github.com>
Mon, 22 Sep 2025 19:29:26 +0000 (00:59 +0530)
commit7235bb7dcd13cc2c219f8e680ba65e31199d4791
tree965c71b1b9cba78ecd1cae4d0446bebe0d21ac8a
parent5028ef71e0ce80ee3ec4cb3b557f5f40201551e7
encoding: Add a test-only function for temporarily registering compressors (#8587)

Fixes: https://github.com/grpc/grpc-go/issues/7960
This PR adds a function that allows tests to register a compressor with
arbitrary names and un-register them at the end of the test. This
prevents the compressor names from showing up in the encoding header in
subsequent tests. Previously, tests were using the name of the existing
compressor "gzip" and re-registering the original compressor to
workaround this problem.

RELEASE NOTES: N/A
encoding/compressor_test.go [new file with mode: 0644]
encoding/encoding.go
encoding/encoding_test.go
encoding/internal/internal.go [new file with mode: 0644]
test/compressor_test.go