mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-14 00:16:21 +00:00
fix: url uploads failing with missing content-type
This commit is contained in:
parent
851eaacd8e
commit
71a6adc3d3
@ -442,13 +442,15 @@ self.actuallyUploadUrls = async (req, res, user, albumid, age) => {
|
|||||||
throw new ServerError(`${fetchFile.status} ${fetchFile.statusText}`)
|
throw new ServerError(`${fetchFile.status} ${fetchFile.statusText}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const contentType = fetchFile.headers.get('content-type')
|
||||||
|
|
||||||
infoMap.push({
|
infoMap.push({
|
||||||
path: destination,
|
path: destination,
|
||||||
data: {
|
data: {
|
||||||
filename: name,
|
filename: name,
|
||||||
originalname: original,
|
originalname: original,
|
||||||
extname,
|
extname,
|
||||||
mimetype: fetchFile.headers.get('content-type').split(';')[0] || '',
|
mimetype: contentType ? contentType.split(';')[0] : '',
|
||||||
size: outStream.bytesWritten,
|
size: outStream.bytesWritten,
|
||||||
hash: hash.digest('hex'),
|
hash: hash.digest('hex'),
|
||||||
albumid,
|
albumid,
|
||||||
|
Loading…
Reference in New Issue
Block a user