etcetera icon indicating copy to clipboard operation
etcetera copied to clipboard

Fails when root path includes folder

Open RabidDog opened this issue 10 years ago • 2 comments

Hi

Recently (due to constraints on IIS) I had to redirect urls from http://server.com/config to http://server.com:2379.

I managed to get this working in my fork but when trying to create a pull request it wants to include all previous commits that you have already implemented :)

The line I had to change to get this working is EtcdClient line 28:

 _keysRoot = root.AppendPath("v2").AppendPath("keys");

It is now:

 _keysRoot = root.AppendPath(etcdLocation.LocalPath.Replace("/", string.Empty)).AppendPath("v2").AppendPath("keys");

If you want this in the client, feel free to add it.

Cheers

RabidDog avatar Dec 09 '15 14:12 RabidDog

My apologies, I cleaned this up to include multiple folders, it now reads:

       var path = etcdLocation.LocalPath.StartsWith("/")
            ? etcdLocation.LocalPath.Substring(1)
            : etcdLocation.LocalPath;

        var root = uriBuilder.Uri;
        _keysRoot = root.AppendPath(path).AppendPath("v2").AppendPath("keys");

RabidDog avatar Dec 09 '15 15:12 RabidDog

I will add a test for this and get back to you. Def something I'd like to add.

drusellers avatar Dec 09 '15 16:12 drusellers