parent
d5554e0aa1
commit
ac8e87d79f
|
@ -118,9 +118,9 @@ public class ResourceProperties implements ResourceLoaderAware {
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Resource> getFaviconLocations() {
|
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) {
|
if (this.resourceLoader != null) {
|
||||||
for (String location : staticLocations) {
|
for (String location : this.staticLocations) {
|
||||||
locations.add(this.resourceLoader.getResource(location));
|
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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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));
|
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
|
@Test
|
||||||
public void faviconMappingDisabled() throws IllegalAccessException {
|
public void faviconMappingDisabled() throws IllegalAccessException {
|
||||||
load("spring.mvc.favicon.enabled:false");
|
load("spring.mvc.favicon.enabled:false");
|
||||||
|
|
Loading…
Reference in New Issue