Merge pull request #46208 from shahabkondri

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

Closes gh-46208
This commit is contained in:
Stéphane Nicoll
2025-10-06 08:52:42 +02:00
3 changed files with 8 additions and 1 deletions
@@ -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;
@@ -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");
}
@@ -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");
}