Commit d5554e0a authored by Venil Noronha's avatar Venil Noronha Committed by Stephane Nicoll

Use static-locations properties to locate favicon

Closes gh-5751
parent 247685e9
......@@ -33,6 +33,7 @@ import org.springframework.core.io.ResourceLoader;
* @author Phillip Webb
* @author Brian Clozel
* @author Dave Syer
* @author Venil Noronha
* @since 1.1.0
*/
@ConfigurationProperties(prefix = "spring.resources", ignoreUnknownFields = false)
......@@ -117,10 +118,9 @@ public class ResourceProperties implements ResourceLoaderAware {
}
List<Resource> getFaviconLocations() {
List<Resource> locations = new ArrayList<Resource>(
CLASSPATH_RESOURCE_LOCATIONS.length + 1);
List<Resource> locations = new ArrayList<Resource>(staticLocations.length + 1);
if (this.resourceLoader != null) {
for (String location : CLASSPATH_RESOURCE_LOCATIONS) {
for (String location : staticLocations) {
locations.add(this.resourceLoader.getResource(location));
}
}
......
......@@ -412,7 +412,7 @@ public class WebMvcAutoConfigurationTests {
assertThat(this.context.getBeansOfType(SimpleUrlHandlerMapping.class)
.get("faviconHandlerMapping"), is(notNullValue()));
Map<String, List<Resource>> mappingLocations = getFaviconMappingLocations();
assertThat(mappingLocations.get("/**/favicon.ico").size(), equalTo(5));
assertThat(mappingLocations.get("/**/favicon.ico").size(), equalTo(6));
}
@Test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment