diff --git a/spring-cloud-consul-config/src/main/java/org/springframework/cloud/consul/config/ConsulPropertySource.java b/spring-cloud-consul-config/src/main/java/org/springframework/cloud/consul/config/ConsulPropertySource.java index a7439712..16ad5a3c 100644 --- a/spring-cloud-consul-config/src/main/java/org/springframework/cloud/consul/config/ConsulPropertySource.java +++ b/spring-cloud-consul-config/src/main/java/org/springframework/cloud/consul/config/ConsulPropertySource.java @@ -55,9 +55,10 @@ public class ConsulPropertySource extends EnumerablePropertySource if (values != null) { for (GetValue getValue : values) { - String key = getValue.getKey().replace(context, "").replace('/', '.'); - String value = getDecoded(getValue.getValue()); - if (StringUtils.hasText(key)) { + String key = getValue.getKey(); + if (!StringUtils.endsWithIgnoreCase(key, "/")) { + key = key.replace(context, "").replace('/', '.'); + String value = getDecoded(getValue.getValue()); properties.put(key, value); } }