mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-13 16:06: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}`)
|
||||
}
|
||||
|
||||
const contentType = fetchFile.headers.get('content-type')
|
||||
|
||||
infoMap.push({
|
||||
path: destination,
|
||||
data: {
|
||||
filename: name,
|
||||
originalname: original,
|
||||
extname,
|
||||
mimetype: fetchFile.headers.get('content-type').split(';')[0] || '',
|
||||
mimetype: contentType ? contentType.split(';')[0] : '',
|
||||
size: outStream.bytesWritten,
|
||||
hash: hash.digest('hex'),
|
||||
albumid,
|
||||
|
Loading…
Reference in New Issue
Block a user