|
@@ -7,7 +7,6 @@ const logger = loggerFactory('growi:routes:attachment');
|
|
|
|
|
|
|
|
const { serializePageSecurely } = require('../models/serializers/page-serializer');
|
|
const { serializePageSecurely } = require('../models/serializers/page-serializer');
|
|
|
const { serializeRevisionSecurely } = require('../models/serializers/revision-serializer');
|
|
const { serializeRevisionSecurely } = require('../models/serializers/revision-serializer');
|
|
|
-
|
|
|
|
|
const ApiResponse = require('../util/apiResponse');
|
|
const ApiResponse = require('../util/apiResponse');
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -231,6 +230,12 @@ module.exports = function(crowi, app) {
|
|
|
'Last-Modified': attachment.createdAt.toUTCString(),
|
|
'Last-Modified': attachment.createdAt.toUTCString(),
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ if (!attachment.fileSize) {
|
|
|
|
|
+ res.set({
|
|
|
|
|
+ 'Content-Length': attachment.fileSize,
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// download
|
|
// download
|
|
|
if (forceDownload) {
|
|
if (forceDownload) {
|
|
|
res.set({
|
|
res.set({
|