I’m mostly trying to work around a different problem, which is that Ktor assigns a wrong content type to
.map
files (like
.js.map
in my case, or
.css.map
) and while clients retrieving these files usually don’t care about content type, I wanted to set it as json so that I could see them directly in browser
ribesg
03/15/2021, 3:36 PM
I understand that Ktor should respect the “official” list of mime types so I don’t expect that to change, these kind of files having no default/expected content type anyway. But the inability to somehow override the content type kinda surprised me. I tried an interceptor, but you are not allowed to set the value of the Content-Type header which is weird
h
hhariri
03/15/2021, 3:37 PM
Then that’s a different issue. Could you please log the specific problem with the wrong assignment, or tell me what you’d expect these file types to have?
r
ribesg
03/15/2021, 3:39 PM
As I said there is no specific content type associated to these files, my Google skills only got me to
application/octet-stream
or eventually
application/json
which is useful for specific debugging but may not make sense. I don’t think the mime types list should be changed but I don’t know what should be done to let users do what they want in this case. I’ll open a general issue