@@ -2120,7 +2120,7 @@ func ClientSupportedCompressors(ctx context.Context) ([]string, error) {
21202120 return nil , fmt .Errorf ("failed to fetch the stream from the given context %v" , ctx )
21212121 }
21222122
2123- return strings . Split ( stream .ClientAdvertisedCompressors (), "," ), nil
2123+ return stream .ClientAdvertisedCompressors (), nil
21242124}
21252125
21262126// SetTrailer sets the trailer metadata that will be sent when an RPC returns.
@@ -2160,7 +2160,7 @@ func (c *channelzServer) ChannelzMetric() *channelz.ServerInternalMetric {
21602160
21612161// validateSendCompressor returns an error when given compressor name cannot be
21622162// handled by the server or the client based on the advertised compressors.
2163- func validateSendCompressor (name , clientCompressors string ) error {
2163+ func validateSendCompressor (name string , clientCompressors [] string ) error {
21642164 if name == encoding .Identity {
21652165 return nil
21662166 }
@@ -2169,7 +2169,7 @@ func validateSendCompressor(name, clientCompressors string) error {
21692169 return fmt .Errorf ("compressor not registered %q" , name )
21702170 }
21712171
2172- for _ , c := range strings . Split ( clientCompressors , "," ) {
2172+ for _ , c := range clientCompressors {
21732173 if c == name {
21742174 return nil // found match
21752175 }
0 commit comments