added a header to disable nginx buffering for downloads

This commit is contained in:
Rostislav Raykov
2025-03-20 19:15:38 +02:00
parent 2566e5b1a3
commit e9b8a05098

View File

@@ -568,6 +568,7 @@ public class FileService {
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + URLEncoder.encode(fileEntity.name, StandardCharsets.UTF_8) + "\"")
.header(HttpHeaders.CONTENT_TYPE, "application/octet-stream")
.header(HttpHeaders.CONTENT_LENGTH, String.valueOf(resource.contentLength()))
.header("X-Accel-Buffering", "no")
.body(responseBody);
}