mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-18 17:21:33 +00:00
fix: only accept files upload with files[] field
was always supposed to only accept said field, but i forgot to include the logic during migration from expressjs to hyper-express
This commit is contained in:
parent
14a340922c
commit
6ad8ed7ae6
@ -338,6 +338,10 @@ self.actuallyUpload = async (req, res, data = {}) => {
|
||||
|
||||
// Process files immediately and push into Request.files array
|
||||
if (field.file) {
|
||||
if (field.name !== 'files[]') {
|
||||
throw new ClientError(`Unexpected file-type field: ${field.name}`)
|
||||
}
|
||||
|
||||
// Push immediately as we will only be adding props into the file object down the line
|
||||
const file = {
|
||||
albumid: data.albumid,
|
||||
|
Loading…
Reference in New Issue
Block a user