Skip to content

Commit 905ff9e

Browse files
committed
Don't modify globalConf while creating client.
1 parent 80d552d commit 905ff9e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/client.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,18 @@ function Client(globalConf, SubClientType, topicConf) {
5252
// key is a real conf value
5353
delete globalConf.event_cb;
5454

55+
// These properties are not meant to be user-set.
56+
// Clients derived from this might want to change them, but for
57+
// now we override them.
5558
globalConf['client.software.name'] = 'confluent-kafka-javascript';
5659
globalConf['client.software.version'] = `${bindingVersion}-librdkafka-${Kafka.librdkafkaVersion}`;
5760

5861
this._client = new SubClientType(globalConf, topicConf);
5962

63+
// We should not modify the globalConf object. We have cloned it already.
64+
delete globalConf['client.software.name'];
65+
delete globalConf['client.software.version'];
66+
6067
var extractFunctions = function(obj) {
6168
obj = obj || {};
6269
var obj2 = {};

0 commit comments

Comments
 (0)