Skip to content

Commit d4227b0

Browse files
committed
fixat så problem som kommer up vid commit
1 parent 19d0a48 commit d4227b0

3 files changed

Lines changed: 2 additions & 5 deletions

File tree

src/main/java/org/example/CacheFilter.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
package org.example;
33

44
import java.io.IOException;
5-
import java.nio.file.Path;
6-
import java.nio.file.Paths;
75
import java.util.Comparator;
86
import java.util.concurrent.ConcurrentHashMap;
97
import java.util.concurrent.atomic.AtomicLong;

src/main/java/org/example/StaticFileHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ public void sendGetRequest(OutputStream outputStream, String uri) throws IOExcep
4444
// Cache-nyckel inkluderar nu webRoot för att undvika collisions
4545
String cacheKey = generateCacheKey(sanitizedUri);
4646
byte[] fileBytes = SHARED_CACHE.getOrFetch(cacheKey,
47-
path -> Files.readAllBytes(new File(webRoot, sanitizedUri).toPath())
47+
ignoredPath -> Files.readAllBytes(new File(webRoot, sanitizedUri).toPath())
4848
);
4949

50+
5051
HttpResponseBuilder response = new HttpResponseBuilder();
5152
response.setContentTypeFromFilename(sanitizedUri);
5253
response.setBody(fileBytes);

src/test/java/org/example/StaticFileHandlerTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@
1616

1717
/**
1818
* Unit test class for verifying the behavior of the StaticFileHandler class.
19-
*
2019
* This test class ensures that StaticFileHandler correctly handles GET requests
2120
* for static files, including both cases where the requested file exists and
2221
* where it does not. Temporary directories and files are utilized in tests to
2322
* ensure no actual file system dependencies during test execution.
24-
*
2523
* Key functional aspects being tested include:
2624
* - Correct response status code and content for an existing file.
2725
* - Correct response status code and fallback behavior for a missing file.

0 commit comments

Comments
 (0)