2 Commits

Author SHA1 Message Date
b5fa470801 fix preview tests
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 2m5s
2024-04-20 20:00:47 +01:00
0854c9e76a change cachecontrol for server previews to be lower 2024-04-20 20:00:22 +01:00
2 changed files with 2 additions and 2 deletions

View File

@ -67,7 +67,7 @@ public class ServerController {
CachedMinecraftServer server = serverService.getServer(platform, hostname);
return ResponseEntity.ok()
.cacheControl(CacheControl.maxAge(1, TimeUnit.HOURS).cachePublic())
.cacheControl(CacheControl.maxAge(5, TimeUnit.MINUTES).cachePublic())
.contentType(MediaType.IMAGE_PNG)
.header(HttpHeaders.CONTENT_DISPOSITION, dispositionHeader.formatted(hostname))
.body(serverService.getServerPreview(server, platform, size));

View File

@ -59,7 +59,7 @@ class ServerControllerTests {
@Test
public void ensureServerPreviewLookupSuccess() throws Exception {
mockMvc.perform(get("/server/preview/java/" + testServer)
mockMvc.perform(get("/server/java/preview/" + testServer)
.contentType(MediaType.IMAGE_PNG))
.andExpect(status().isOk());
}