Content-Length добавлен
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package im.rosetta.api;
|
package im.rosetta.api;
|
||||||
|
|
||||||
import im.rosetta.storage.FileStore;
|
import im.rosetta.storage.FileStore;
|
||||||
import jakarta.ws.rs.Consumes;
|
|
||||||
import jakarta.ws.rs.GET;
|
import jakarta.ws.rs.GET;
|
||||||
import jakarta.ws.rs.POST;
|
import jakarta.ws.rs.POST;
|
||||||
import jakarta.ws.rs.Path;
|
import jakarta.ws.rs.Path;
|
||||||
@@ -65,6 +64,7 @@ public class CdnResource {
|
|||||||
StreamingOutput stream = output -> Files.copy(file.get(), output);
|
StreamingOutput stream = output -> Files.copy(file.get(), output);
|
||||||
return Response.ok(stream)
|
return Response.ok(stream)
|
||||||
.header("Content-Disposition", "attachment; filename=\"" + tag + "\"")
|
.header("Content-Disposition", "attachment; filename=\"" + tag + "\"")
|
||||||
|
.header("Content-Length", Files.size(file.get()))
|
||||||
.build();
|
.build();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
return Response.serverError()
|
return Response.serverError()
|
||||||
|
|||||||
Reference in New Issue
Block a user