Browse Source

Merge pull request #46208 from shahabkondri

* pr/46208:
  Polish "Include /fonts/** to common static locations"
  Include /fonts/** to common static locations

Closes gh-46208
pull/47424/head
Stéphane Nicoll 4 months ago
parent
commit
761302452b
  1. 7
      module/spring-boot-security/src/main/java/org/springframework/boot/security/autoconfigure/StaticResourceLocation.java
  2. 1
      module/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/reactive/StaticResourceRequestTests.java
  3. 1
      module/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/StaticResourceRequestTests.java

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

@ -50,7 +50,12 @@ public enum StaticResourceLocation { @@ -50,7 +50,12 @@ public enum StaticResourceLocation {
/**
* The {@code "favicon.ico"} resource.
*/
FAVICON("/favicon.*", "/*/icon-*");
FAVICON("/favicon.*", "/*/icon-*"),
/**
* Resources under {@code "/fonts"}.
*/
FONTS("/fonts/**");
private final String[] patterns;

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

@ -57,6 +57,7 @@ class StaticResourceRequestTests { @@ -57,6 +57,7 @@ class StaticResourceRequestTests {
assertMatcher(matcher).matches("/favicon.ico");
assertMatcher(matcher).matches("/favicon.png");
assertMatcher(matcher).matches("/icons/icon-48x48.png");
assertMatcher(matcher).matches("/fonts/font.woff2");
assertMatcher(matcher).doesNotMatch("/bar");
}

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

@ -51,6 +51,7 @@ class StaticResourceRequestTests { @@ -51,6 +51,7 @@ class StaticResourceRequestTests {
assertMatcher(matcher).matches("/favicon.ico");
assertMatcher(matcher).matches("/favicon.png");
assertMatcher(matcher).matches("/icons/icon-48x48.png");
assertMatcher(matcher).matches("/fonts/font.woff2");
assertMatcher(matcher).doesNotMatch("/bar");
}

Loading…
Cancel
Save