Merge pull request #585 from dl1ely/master
Clean Windows paths before guessing the service name
This commit is contained in:
@@ -111,7 +111,7 @@ public class PropertyPathEndpoint
|
||||
Set<String> services = new LinkedHashSet<>();
|
||||
if (path != null) {
|
||||
String stem = StringUtils
|
||||
.stripFilenameExtension(StringUtils.getFilename(path));
|
||||
.stripFilenameExtension(StringUtils.getFilename(StringUtils.cleanPath(path)));
|
||||
// TODO: correlate with service registry
|
||||
int index = stem.indexOf("-");
|
||||
while (index >= 0) {
|
||||
|
||||
@@ -86,6 +86,15 @@ public class PropertyPathEndpointTests {
|
||||
.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotifyOneWithWindowsPath() throws Exception {
|
||||
assertEquals("[foo]",
|
||||
this.endpoint
|
||||
.notifyByPath(new HttpHeaders(), Collections
|
||||
.<String, Object> singletonMap("path", "C:\\config\\foo.yml"))
|
||||
.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNotifyOneWithProfile() throws Exception {
|
||||
assertEquals("[foo:local, foo-local]",
|
||||
|
||||
Reference in New Issue
Block a user