Sending a response "at the beginning" 2xx before receiving a request

I upload a file in the Play Framework, but I get this warning:

[play-dev-mode-akka.actor.default-dispatcher-47] [akka.actor.ActorSystemImpl (play-dev-mode)] Send a response "at the beginning" 2xx before the final request was received ... Please note that the connection will be closed after this answer. In addition, many customers will not read the early answers! Consider giving this answer only after the request data has been completely read!

I really don't know if this is a warning to worry, or I need to take care of my code implementation.

This is my actual code to download the file:

public Result imageUpload(){
    try{
         MultipartFormData<File> body = request().body().asMultipartFormData();
          FilePart<File> picture = body.getFile("file");
          String fileName = picture.getFilename();
          String contentType = picture.getContentType();
            File file = picture.getFile();
          System.out.println(picture);
          System.out.println(fileName);
          System.out.println(contentType);
          System.out.println(file);


    }catch (Exception e) {
        // TODO: handle exception
    }
    return ok();
}

Do you think that something is wrong with this?

+4

Source: https://habr.com/ru/post/1684548/


All Articles