spring-projects / spring-projects/spring-data-rest
Chrome locks up when sending a POST of large file and a "return "redirect: "" is returned from controller [DATAREST-1081]
@odrotbohm is already working on this.
Since Dec 31, 2020.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
Kevin Vasko opened DATAREST-1081 and commented
Using this code in a @Controller class.
@PostMapping("/upload-test-bug")
public String handleFileUpload(@RequestParam("file") MultipartFile file,
RedirectAttributes redirectAttributes) {
return "redirect:/";
}
I also put this in my application.properties file.
spring.http.multipart.maxFileSize=16MB
spring.http.multipart.maxRequestSize=16MB
Using Chrome (and Postman plugin). If I issue a post of a small file < 15KB Chrome gets redirected to the appropriate REST URL (in this case /). If I issue a post of a larger file ~4MB Chrome sends the file, and locks up (Chrome uses 100% of a core) and goes into a non-responsive state.
I did some debugging with Wireshark.
When a small file is uploaded I'll see.
- File upload and associated ACKs
- Redirect issued (HTTP/1.1 302)
- ACK from client
- GET / HTTP/1.1
When a large file (4MB) is uploaded I'll see.
1)File upload and associated ACKs
2) Redirect issued (HTTP/1.1 302)
3) ACK from client
4) .... nothing...
It is almost like Chrome is not taking the redirect correctly. I can reproduce this with a blank Spring Boot 1.5.3 project and the above code in a @controller class.
Affects: 2.6.3 (Ingalls SR3)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.