From 02b7005b49380bacaba21dc112586c17e4303cf7 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Wed, 12 Aug 2015 11:54:41 -0700 Subject: [PATCH] Clarified address regex --- src/client.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client.js b/src/client.js index 4e631456..bbb45382 100644 --- a/src/client.js +++ b/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;