orangy
contentType
is not bound to get
but instead to the routing root (because of receiver match rules). What in fact happens is this:
routing {
contentType(ContentType.Application.Json) {
println("JSON, as expected")
}
contentType(ContentType.Video.MP4) {
println("Will never happen, we are safe")
throw Exception("Oops, I didn't expected this branch to be executed!!")
}
get("/v1") {
call.respond(JsonResponse(model))
}