【发布时间】:2020-04-02 02:37:45
【问题描述】:
我的 zuul 代理有问题,它与请求的大小有关,我总是收到 500 错误连接已在响应之前关闭。
控制器代码:
@RestController
@RequestMapping("/file")
public class FileController {
@PostMapping("/upload")
public ResponseEntity<String> uploadFile(@RequestParam("file") MultipartFile file) throws Exception {
System.out.println("File Name : " + file.getOriginalFilename(),
"File Size : " + file.getSize() + "bytes");
return ResponseEntity.ok(file.getName() + " uploaded");
}
}
有什么想法吗?
【问题讨论】:
-
您是否尝试过使用断点进行调试?它是在打印文件名之后还是之前中断?
标签: java spring spring-boot netflix-zuul