From a5d2140793102c8c489756cf29a52fe850f849e4 Mon Sep 17 00:00:00 2001 From: Arches Date: Mon, 26 Sep 2016 11:56:04 +0200 Subject: [PATCH] Updated logic for stripping of endpoint --- src/Client.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Client.cpp b/src/Client.cpp index 6fc8153..4bf24b6 100644 --- a/src/Client.cpp +++ b/src/Client.cpp @@ -24,12 +24,12 @@ using grpc::Channel; etcd::Client::Client(std::string const & address) { - std::string stripped_address(address); - std::string substr("http://"); - std::string::size_type i = stripped_address.find(substr); + std::string stripped_address; + std::string substr("://"); + std::string::size_type i = address.find(substr); if(i != std::string::npos) { - stripped_address.erase(i,substr.length()); + stripped_address = address.substr(i+substr.length()); } std::shared_ptr channel = grpc::CreateChannel(stripped_address, grpc::InsecureChannelCredentials()); stub_= KV::NewStub(channel);