How can I set the allowed upload size to ktor?
# ktor
a
How can I set the allowed upload size to ktor?
I ended up doing:
Copy code
val contentLength = call.request.headers["Content-Length"]?.toLong()
        if (contentLength == null) {
            call.respond(HttpStatusCode.LengthRequired)
        } else if (contentLength > MAX_SIZE) {
            call.respond(HttpStatusCode.PayloadTooLarge)
        }
works alright for my needs. Currently there is only one post request that accepts files so I am only doing it there.