Lev Teytelman
11/01/2023, 4:41 AMApplicationCall#respondFile
? It seems like using wrapHeaders
in the configure
block doesn't have access to the headers that are later appended, and Ktor uses an unsatisfactory way of getting the content type for me (using the file extension). I assume I would be able to emulate respondFile
if all else fails, but that would likely mean having to handle partial gets as well and so I'd like to avoid it if possible. I'm currently getting a result like this when appending the Content-Type manually.Aleksei Tirman [JB]
11/01/2023, 7:42 AMLocalFileContent
class directly:
routing {
get {
call.respond(LocalFileContent(File("file.jpg"), contentType = ContentType.Text.Plain))
}
}