Skip to content

Commit 7613024

Browse files
committed
Merge pull request #46208 from shahabkondri
* pr/46208: Polish "Include /fonts/** to common static locations" Include /fonts/** to common static locations Closes gh-46208
2 parents 169b1b1 + 3f2e1b2 commit 7613024

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

module/spring-boot-security/src/main/java/org/springframework/boot/security/autoconfigure/StaticResourceLocation.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ public enum StaticResourceLocation {
5050
/**
5151
* The {@code "favicon.ico"} resource.
5252
*/
53-
FAVICON("/favicon.*", "/*/icon-*");
53+
FAVICON("/favicon.*", "/*/icon-*"),
54+
55+
/**
56+
* Resources under {@code "/fonts"}.
57+
*/
58+
FONTS("/fonts/**");
5459

5560
private final String[] patterns;
5661

module/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/reactive/StaticResourceRequestTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ void atCommonLocationsShouldMatchCommonLocations() {
5757
assertMatcher(matcher).matches("/favicon.ico");
5858
assertMatcher(matcher).matches("/favicon.png");
5959
assertMatcher(matcher).matches("/icons/icon-48x48.png");
60+
assertMatcher(matcher).matches("/fonts/font.woff2");
6061
assertMatcher(matcher).doesNotMatch("/bar");
6162
}
6263

module/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/StaticResourceRequestTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ void atCommonLocationsShouldMatchCommonLocations() {
5151
assertMatcher(matcher).matches("/favicon.ico");
5252
assertMatcher(matcher).matches("/favicon.png");
5353
assertMatcher(matcher).matches("/icons/icon-48x48.png");
54+
assertMatcher(matcher).matches("/fonts/font.woff2");
5455
assertMatcher(matcher).doesNotMatch("/bar");
5556
}
5657

0 commit comments

Comments
 (0)