etcetera
etcetera copied to clipboard
Fails when root path includes folder
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
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");
I will add a test for this and get back to you. Def something I'd like to add.