Fix unused variable
authorLanius Trolling <lanius@laniustrolling.dev>
Fri, 12 Apr 2024 00:33:27 +0000 (20:33 -0400)
committerLanius Trolling <lanius@laniustrolling.dev>
Fri, 12 Apr 2024 00:33:27 +0000 (20:33 -0400)
src/jvmMain/kotlin/info/mechyrdia/data/data_files.kt

index 389132785a79c5475b81036440b8570c0aec2785..d7941e4d5e220e4907d7556cdd6b04e8e14877b8 100644 (file)
@@ -30,11 +30,9 @@ import kotlin.String
 import kotlin.time.Duration.Companion.hours
 
 suspend fun ApplicationCall.respondStoredFile(fileStorage: FileStorage, path: StoragePath) {
-       val stat = fileStorage.statFile(path) ?: return respond(HttpStatusCode.NotFound)
-       
+       val content = fileStorage.readFile(path) ?: return respond(HttpStatusCode.NotFound)
        val extension = path.elements.last().substringAfter('.', "")
        val type = if (extension.isEmpty()) ContentType.Text.Plain else ContentType.defaultForFileExtension(extension)
-       val content = fileStorage.readFile(path) ?: return respond(HttpStatusCode.NotFound)
        
        attributes.put(StoragePathAttributeKey, path)
        respondBytes(content, type)