Properly set content-type when Range header is present
This commit is contained in:
parent
00e21b27a5
commit
5c002f7ff2
@ -110,8 +110,16 @@ export default class GiteaRepoLatestReleaseController extends Controller {
|
|||||||
await promisify(fs.rename)(tmpAssetPath, assetPath);
|
await promisify(fs.rename)(tmpAssetPath, assetPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const options: Record<string, unknown> = {};
|
||||||
|
|
||||||
|
if (req.header('Range')) {
|
||||||
|
options.headers = {
|
||||||
|
'Content-Type': 'multipart/byteranges',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Respond
|
// Respond
|
||||||
return res.download(assetPath, downloadProperties.asset.name);
|
return res.download(assetPath, downloadProperties.asset.name, options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user