Properly set content-type when Range header is present

This commit is contained in:
Alice Gaudon 2020-11-20 13:38:47 +01:00
parent 00e21b27a5
commit 5c002f7ff2

View File

@ -110,8 +110,16 @@ export default class GiteaRepoLatestReleaseController extends Controller {
await promisify(fs.rename)(tmpAssetPath, assetPath);
}
const options: Record<string, unknown> = {};
if (req.header('Range')) {
options.headers = {
'Content-Type': 'multipart/byteranges',
};
}
// Respond
return res.download(assetPath, downloadProperties.asset.name);
return res.download(assetPath, downloadProperties.asset.name, options);
}
}