Include /fonts/** to common static locations
This commit updates StaticResourceLocation to include a new entry for the common locations of fonts. As a result, StaticResourceRequest#atCommonLocations now includes /fonts/** as well. See gh-46208 Signed-off-by: Shahab Kondri <shahab.kondri@gmail.com>
This commit is contained in:
parent
169b1b10b0
commit
74daedff76
|
@ -50,7 +50,12 @@ public enum StaticResourceLocation {
|
||||||
/**
|
/**
|
||||||
* The {@code "favicon.ico"} resource.
|
* The {@code "favicon.ico"} resource.
|
||||||
*/
|
*/
|
||||||
FAVICON("/favicon.*", "/*/icon-*");
|
FAVICON("/favicon.*", "/*/icon-*"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resources under {@code "/fonts"}.
|
||||||
|
*/
|
||||||
|
FONTS("/fonts/**");
|
||||||
|
|
||||||
private final String[] patterns;
|
private final String[] patterns;
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ class StaticResourceRequestTests {
|
||||||
assertMatcher(matcher).matches("/favicon.ico");
|
assertMatcher(matcher).matches("/favicon.ico");
|
||||||
assertMatcher(matcher).matches("/favicon.png");
|
assertMatcher(matcher).matches("/favicon.png");
|
||||||
assertMatcher(matcher).matches("/icons/icon-48x48.png");
|
assertMatcher(matcher).matches("/icons/icon-48x48.png");
|
||||||
|
assertMatcher(matcher).matches("/fonts/font.woff2");
|
||||||
assertMatcher(matcher).doesNotMatch("/bar");
|
assertMatcher(matcher).doesNotMatch("/bar");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue