From 49ec795941374187b11f64aaa7475e8f800a3cce Mon Sep 17 00:00:00 2001 From: Bobby Wibowo Date: Sun, 21 Jun 2020 22:21:38 +0700 Subject: [PATCH] Disabled file delete GET API 40dd66297612b2a8429c8fcad2b07170a3ba582b#commitcomment-40060391 --- controllers/uploadController.js | 4 ++-- routes/api.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/uploadController.js b/controllers/uploadController.js index be173b9..341a0d5 100644 --- a/controllers/uploadController.js +++ b/controllers/uploadController.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) diff --git a/routes/api.js b/routes/api.js index 00ae36f..85f0d40 100644 --- a/routes/api.js +++ b/routes/api.js @@ -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))