fix: Forward headers correctly when reading from S3

This commit is contained in:
Maksim Eltyshev
2026-02-04 11:34:47 +01:00
parent 3c33161df6
commit 8df5a111bf
2 changed files with 24 additions and 14 deletions
@@ -51,15 +51,13 @@ class LocalFileManager {
const readStream = fs.createReadStream(filePath);
if (withHeaders) {
const weakEtag = `W/"${stat.size.toString(16)}-${stat.mtime.getTime().toString(16)}"`;
return [
readStream,
{
'Content-Type': mime.lookup(filePathSegment) || 'application/octet-stream',
'Content-Length': stat.size,
'Last-Modified': stat.mtime.toUTCString(),
ETag: weakEtag,
ETag: `W/"${stat.size.toString(16)}-${stat.mtime.getTime().toString(16)}"`,
'Accept-Ranges': 'bytes',
},
];