Skip to content

Commit 62aa1b7

Browse files
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
1 parent fdd028d commit 62aa1b7

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ private void load(PropertySourceLoader loader, String location, Profile profile,
569569
private boolean hasHiddenPathElement(Resource resource) throws IOException {
570570
String cleanPath = StringUtils.cleanPath(resource.getFile().getAbsolutePath());
571571
for (Path value : Paths.get(cleanPath)) {
572-
if (value.toString().startsWith(".")) {
572+
if (value.toString().startsWith("..")) {
573573
return true;
574574
}
575575
}

0 commit comments

Comments
 (0)