Skip to content

Commit d5554e0

Browse files
venilnoronhasnicoll
authored andcommitted
Use static-locations properties to locate favicon
Closes gh-5751
1 parent 247685e commit d5554e0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ResourceProperties.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
* @author Phillip Webb
3434
* @author Brian Clozel
3535
* @author Dave Syer
36+
* @author Venil Noronha
3637
* @since 1.1.0
3738
*/
3839
@ConfigurationProperties(prefix = "spring.resources", ignoreUnknownFields = false)
@@ -117,10 +118,9 @@ private String[] getStaticWelcomePageLocations() {
117118
}
118119

119120
List<Resource> getFaviconLocations() {
120-
List<Resource> locations = new ArrayList<Resource>(
121-
CLASSPATH_RESOURCE_LOCATIONS.length + 1);
121+
List<Resource> locations = new ArrayList<Resource>(staticLocations.length + 1);
122122
if (this.resourceLoader != null) {
123-
for (String location : CLASSPATH_RESOURCE_LOCATIONS) {
123+
for (String location : staticLocations) {
124124
locations.add(this.resourceLoader.getResource(location));
125125
}
126126
}

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfigurationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ public void faviconMapping() throws IllegalAccessException {
412412
assertThat(this.context.getBeansOfType(SimpleUrlHandlerMapping.class)
413413
.get("faviconHandlerMapping"), is(notNullValue()));
414414
Map<String, List<Resource>> mappingLocations = getFaviconMappingLocations();
415-
assertThat(mappingLocations.get("/**/favicon.ico").size(), equalTo(5));
415+
assertThat(mappingLocations.get("/**/favicon.ico").size(), equalTo(6));
416416
}
417417

418418
@Test

0 commit comments

Comments
 (0)