It works because I can see browser stop uploading.
However, action does not return result. It looks like action is blocked or something.
@BodyParser.Of(value = BodyParser.MultipartFormData.class, maxLength = 1024 * 1024)
pulic static Result index() {
if(request().body().isMaxSizeExceeded()) {
return badRequest("Too much data!"); // this is not returned
} else {
ok("Got body: " + request().body().asText());
}
}