fix content-type

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-10-25 16:40:59 +02:00
parent 6f9245158f
commit c31d8f4c7a
No known key found for this signature in database
GPG Key ID: C8787EFEB4B64AF0

View File

@ -53,7 +53,7 @@ async function minioUpload (minio: Client, workspace: string, file: UploadedFile
'Content-Type': file.mimetype
}
const resp = await minio.putObject(workspace, id, file.data, meta)
const resp = await minio.putObject(workspace, id, file.data, file.size, meta)
console.log(resp)
return id
@ -96,7 +96,12 @@ export function start (transactorEndpoint: string, elasticUrl: string, minio: Cl
return console.log(err)
}
res.status(200)
res.setHeader('Content-Type', stat.metaData['Content-Type'])
const contentType = stat.metaData['content-type']
if (contentType !== undefined) {
res.setHeader('Content-Type', contentType)
}
dataStream.on('data', function (chunk) {
res.write(chunk)
})