aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2015-08-12 11:54:41 -0700
committerGravatar murgatroid99 <mlumish@google.com>2015-08-12 11:54:41 -0700
commite804777708d7808b4892837afd271a2e7ef4b42e (patch)
tree6ebc46c60d821ba825699fc9a1f03a3c5e0dd168
parent4fdb2d5c8076c57c4ccdcc09216f6a35141b4fca (diff)
Clarified address regex
-rw-r--r--src/node/src/client.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node/src/client.js b/src/node/src/client.js
index 4e63145642..bbb4538281 100644
--- a/src/node/src/client.js
+++ b/src/node/src/client.js
@@ -548,8 +548,8 @@ exports.makeClientConstructor = function(methods, serviceName) {
}
options['grpc.primary_user_agent'] = 'grpc-node/' + version;
this.channel = new grpc.Channel(address, credentials, options);
- // Extract the DNS name from the address string
- address = address.replace(/(\w+:\/\/+)?([^:]+)(:\d+)?\/?$/, '$2');
+ // Remove the optional DNS scheme, trailing port, and trailing backslash
+ address = address.replace(/^(dns:\/{3})?([^:\/]+)(:\d+)?\/?$/, '$2');
this.server_address = address;
this.auth_uri = 'https://' + this.server_address + '/' + serviceName;
this.updateMetadata = updateMetadata;