Skip to content

Commit 47bb8b6

Browse files
committed
move string split down to where it matters
1 parent c9659b5 commit 47bb8b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/grpc-js/src/compression-filter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,11 @@ export class CompressionFilter extends BaseFilter implements Filter {
188188
constructor(channelOptions: ChannelOptions, private sharedFilterConfig: SharedCompressionFilterConfig) {
189189
super();
190190

191-
const serverSupportedEncodings = sharedFilterConfig.serverSupportedEncodingHeader?.split(',');
192191
const compressionAlgorithmKey = channelOptions['grpc.default_compression_algorithm'];
193192
if (compressionAlgorithmKey !== undefined) {
194193
if (isCompressionAlgorithmKey(compressionAlgorithmKey)) {
195194
const clientSelectedEncoding = CompressionAlgorithms[compressionAlgorithmKey];
195+
const serverSupportedEncodings = sharedFilterConfig.serverSupportedEncodingHeader?.split(',');
196196
/**
197197
* There are two possible situations here:
198198
* 1) We don't have any info yet from the server about what compression it supports

0 commit comments

Comments
 (0)