Content-Length добавлен

This commit is contained in:
RoyceDa
2026-02-16 23:39:57 +02:00
parent 6d3e6657ee
commit 91b7cfa911

View File

@@ -34,6 +34,7 @@ public class FilesResource {
File target = resolved.toFile(); File target = resolved.toFile();
return Response.ok(target) return Response.ok(target)
.header("Content-Disposition", "attachment; filename=\"" + target.getName() + "\"") .header("Content-Disposition", "attachment; filename=\"" + target.getName() + "\"")
.header("Content-Length", target.length())
.build(); .build();
} }
@@ -50,6 +51,7 @@ public class FilesResource {
File target = resolved.toFile(); File target = resolved.toFile();
return Response.ok(target) return Response.ok(target)
.header("Content-Disposition", "attachment; filename=\"" + target.getName() + "\"") .header("Content-Disposition", "attachment; filename=\"" + target.getName() + "\"")
.header("Content-Length", target.length())
.build(); .build();
} }
} }