Disabled file delete GET API

40dd66297612b2a8429c8fcad2b07170a3ba582b#commitcomment-40060391
safe.fiery.me
Bobby Wibowo 3 years ago
parent 40dd662976
commit 49ec795941
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
  1. 4
      controllers/uploadController.js
  2. 2
      routes/api.js

@ -776,14 +776,14 @@ self.delete = async (req, res) => {
field: 'id',
values: isNaN(id) ? undefined : [id]
}
} else if (req.method === 'GET') {
} /* else if (req.method === 'GET') {
// ShareX-compatible API (or other clients that require basic GET-based API)
const name = req.params.name
body = {
field: 'name',
values: name ? [name] : undefined
}
}
} */
req.body = body
return self.bulkDelete(req, res)

@ -27,7 +27,7 @@ routes.get('/uploads', (req, res, next) => uploadController.list(req, res, next)
routes.get('/uploads/:page', (req, res, next) => uploadController.list(req, res, next))
routes.post('/upload', (req, res, next) => uploadController.upload(req, res, next))
routes.post('/upload/delete', (req, res, next) => uploadController.delete(req, res, next))
routes.get('/upload/delete/:name', (req, res, next) => uploadController.delete(req, res, next))
// routes.get('/upload/delete/:name', (req, res, next) => uploadController.delete(req, res, next))
routes.post('/upload/bulkdelete', (req, res, next) => uploadController.bulkDelete(req, res, next))
routes.post('/upload/finishchunks', (req, res, next) => uploadController.finishChunks(req, res, next))
routes.post('/upload/:albumid', (req, res, next) => uploadController.upload(req, res, next))

Loading…
Cancel
Save