mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Fix location of head return call
This commit is contained in:
@@ -154,14 +154,6 @@ router.get(
|
||||
|
||||
const { stream, file, stat } = await service.getAsset(id, transformation, range);
|
||||
|
||||
if (req.method.toLowerCase() === 'head') {
|
||||
res.status(200);
|
||||
res.setHeader('Accept-Ranges', 'bytes');
|
||||
res.setHeader('Content-Length', stat.size);
|
||||
|
||||
return res.end();
|
||||
}
|
||||
|
||||
const access = req.accountability?.role ? 'private' : 'public';
|
||||
|
||||
res.attachment(req.params.filename ?? file.filename_download);
|
||||
@@ -187,6 +179,14 @@ router.get(
|
||||
res.removeHeader('Content-Disposition');
|
||||
}
|
||||
|
||||
if (req.method.toLowerCase() === 'head') {
|
||||
res.status(200);
|
||||
res.setHeader('Accept-Ranges', 'bytes');
|
||||
res.setHeader('Content-Length', stat.size);
|
||||
|
||||
return res.end();
|
||||
}
|
||||
|
||||
stream.on('data', (chunk) => res.write(chunk));
|
||||
|
||||
stream.on('end', () => {
|
||||
|
||||
Reference in New Issue
Block a user