fix: classloaderの呼び出しを変更

This commit is contained in:
usbharu 2023-04-01 10:37:31 +09:00
parent 6de06a9bde
commit 46c075bf6d
2 changed files with 13 additions and 1 deletions

View File

@ -67,7 +67,7 @@ fun Application.user(userService: UserService, activityPubUserService: ActivityP
}
}
get("/{name}/icon.png"){
call.respondBytes(Application::class.java.classLoader.getResourceAsStream("/icon.png").readAllBytes(),ContentType.Image.PNG)
call.respondBytes(javaClass.classLoader.getResourceAsStream("icon.png").readAllBytes(),ContentType.Image.PNG)
}
}

View File

@ -0,0 +1,12 @@
package dev.usbharu.hideout.routing
import org.junit.jupiter.api.Test
class UserRoutingKtTest {
@Test
fun userIconTest() {
println(String.Companion::class.java.classLoader)
println(String::class.java.classLoader)
println(String.javaClass.classLoader.getResourceAsStream("icon.png")?.readAllBytes())
}
}