I'm testing an API that takes a multipart/form-data file upload which works fine with Ktor for happy paths.
In an environment where the maximum JVM heap size is 128MB though, if I try to upload a 40MB file it crashes with an Out of Heap exception without ever reaching even the first line of my code. In other words, it breaks in Ktor code. Is Ktor attempting to read the entire file into memory for each request? My intent was to just read up to X MB and then throw an exception if that upper limit is passed.