Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
ac8e87d7
Commit
ac8e87d7
authored
Apr 26, 2016
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish contribution
Closes gh-5782
parent
d5554e0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
ResourceProperties.java
...gframework/boot/autoconfigure/web/ResourceProperties.java
+2
-2
WebMvcAutoConfigurationTests.java
.../boot/autoconfigure/web/WebMvcAutoConfigurationTests.java
+8
-1
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ResourceProperties.java
View file @
ac8e87d7
...
...
@@ -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
));
}
}
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfigurationTests.java
View file @
ac8e87d7
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
6
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"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment