fix: url uploads content-type parsing

This commit is contained in:
Bobby 2022-10-06 04:24:28 +07:00
parent 3d51fd2e31
commit 066998991c
No known key found for this signature in database
GPG Key ID: 941839794CBF5A09

View File

@ -707,7 +707,7 @@ self.actuallyUploadUrls = async (req, res, data = {}) => {
// Finalize other file props
const contentType = fetchFile.headers.get('content-type')
file.mimetype = contentType ? contentType.split(';')[0] : 'application/octet-stream'
file.mimetype = (contentType && contentType.split(';')[0]) || 'application/octet-stream'
file.size = writeStream.bytesWritten
file.hash = hashStream
? hashStream.digest('hex')