Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ public class WebMvcConfig implements WebMvcConfigurer {
private static final String CONTENT_HASHED_ASSET_PATH_PATTERN = "/assets/**";
private static final String CONTENT_HASHED_ASSET_LOCATION = "classpath:/static/assets/";
private static final Duration CONTENT_HASHED_ASSET_CACHE_MAX_AGE = Duration.ofDays(365);
private static final String FONT_PATH_PATTERN = "/fonts/**";
private static final String FONT_RESOURCE_LOCATION = "classpath:/static/fonts/";
private static final String SITE_MANIFEST_PATH = "/site.webmanifest";
private static final String STATIC_RESOURCE_LOCATION = "classpath:/static/";
private static final Duration UNVERSIONED_STATIC_RESOURCE_CACHE_MAX_AGE = Duration.ofHours(1);
Expand Down Expand Up @@ -82,10 +80,6 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) {
.setCacheControl(CacheControl.maxAge(CONTENT_HASHED_ASSET_CACHE_MAX_AGE)
.cachePublic()
.immutable());
registry.addResourceHandler(FONT_PATH_PATTERN)
.addResourceLocations(FONT_RESOURCE_LOCATION)
.setCacheControl(CacheControl.maxAge(UNVERSIONED_STATIC_RESOURCE_CACHE_MAX_AGE)
.cachePublic());
registry.addResourceHandler(SITE_MANIFEST_PATH)
.addResourceLocations(STATIC_RESOURCE_LOCATION)
.setCacheControl(CacheControl.maxAge(UNVERSIONED_STATIC_RESOURCE_CACHE_MAX_AGE)
Expand Down
93 changes: 0 additions & 93 deletions src/main/resources/static/fonts/Fraunces-OFL.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.when;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.head;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header;
Expand Down Expand Up @@ -55,7 +54,6 @@ class SecurityConfigTest {
"CSRF token missing or invalid. Refresh the page and retry the request.";
private static final String CONTENT_HASHED_ASSET_PATH = "/assets/application-a1b2c3d4.js";
private static final String CONTENT_HASHED_ASSET_CACHE_CONTROL = "max-age=31536000, public, immutable";
private static final String FONT_ASSET_PATH = "/fonts/Fraunces-Variable.ttf";
private static final String SITE_MANIFEST_PATH = "/site.webmanifest";
private static final String UNVERSIONED_STATIC_RESOURCE_CACHE_CONTROL = "max-age=3600, public";
private static final String HTML_SHELL_PATH = "/index.html";
Expand Down Expand Up @@ -198,10 +196,6 @@ void servesContentHashedAssetsWithImmutablePublicCachingWithoutCsrfCookie() thro

@Test
void servesUnversionedStaticResourcesWithBoundedPublicCachingWithoutCsrfCookie() throws Exception {
mockMvc.perform(head(FONT_ASSET_PATH))
.andExpect(status().isOk())
.andExpect(header().string(HttpHeaders.CACHE_CONTROL, UNVERSIONED_STATIC_RESOURCE_CACHE_CONTROL))
.andExpect(header().doesNotExist(HttpHeaders.SET_COOKIE));
assertBoundedPublicStaticResource(SITE_MANIFEST_PATH);
}

Expand Down