Polish contribution
Closes gh-5782
This commit is contained in:
@@ -118,9 +118,9 @@ public class ResourceProperties implements ResourceLoaderAware {
|
||||
}
|
||||
|
||||
List<Resource> getFaviconLocations() {
|
||||
List<Resource> locations = new ArrayList<Resource>(staticLocations.length + 1);
|
||||
List<Resource> locations = new ArrayList<Resource>(this.staticLocations.length + 1);
|
||||
if (this.resourceLoader != null) {
|
||||
for (String location : staticLocations) {
|
||||
for (String location : this.staticLocations) {
|
||||
locations.add(this.resourceLoader.getResource(location));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -415,6 +415,13 @@ public class WebMvcAutoConfigurationTests {
|
||||
assertThat(mappingLocations.get("/**/favicon.ico").size(), equalTo(6));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void faviconMappingUsesStaticLocations() throws IllegalAccessException {
|
||||
load("spring.resources.static-locations=classpath:/static");
|
||||
Map<String, List<Resource>> mappingLocations = getFaviconMappingLocations();
|
||||
assertThat(mappingLocations.get("/**/favicon.ico").size(), equalTo(2));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void faviconMappingDisabled() throws IllegalAccessException {
|
||||
load("spring.mvc.favicon.enabled:false");
|
||||
|
||||
Reference in New Issue
Block a user