Assume you receive a POST request with a body as a byte array. Write a RequestValidation configuration in Ktor that only validates the request if the body is indeed a byte array.
install(RequestValidation) {
validate {
filter { body -> /* your code here */ }
validation { body ->
// Your validation logic here...
}
}
}