Narrow criteria for hidden property paths
A previous change intended to prevent temporary directories created as an implementation detail of mounting volumes on kubernetes pods from being used as a source for property files had a side-effect of also preventing other types of hidden directories from being recognized. This commit narrows the criteria for considering a directory as hidden, using the kubernetes `..` prefix convention instead of the Unix `.` prefix. Fixes gh-23983
This commit is contained in:
@@ -569,7 +569,7 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor,
|
||||
private boolean hasHiddenPathElement(Resource resource) throws IOException {
|
||||
String cleanPath = StringUtils.cleanPath(resource.getFile().getAbsolutePath());
|
||||
for (Path value : Paths.get(cleanPath)) {
|
||||
if (value.toString().startsWith(".")) {
|
||||
if (value.toString().startsWith("..")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user