minor code improvement

This commit is contained in:
2025-09-29 09:24:32 +02:00
parent 1d90683b3e
commit f904513bfe

View File

@@ -110,7 +110,9 @@ public class FileModule extends BaseHandler implements FileService {
headers.add(CONTENT_TYPE, ct);
headers.add(CONTENT_DISPOSITION,"attachment; filename=\""+file.getName()+"\"");
ex.sendResponseHeaders(HTTP_OK, 0L);
new FileInputStream(file).transferTo(ex.getResponseBody());
try (var fos = new FileInputStream(file)){
fos.transferTo(ex.getResponseBody());
}
return true;
}