Browse Source

Little fix

kanadeko 7 years ago
parent
commit
3777c01465
2 changed files with 3 additions and 3 deletions
  1. 2 2
      controllers/galleryController.js
  2. 1 1
      controllers/uploadController.js

+ 2 - 2
controllers/galleryController.js

@@ -6,7 +6,7 @@ let galleryController = {}
 galleryController.list = function(req, res, next){
 	
 	if(config.TOKEN === true)
-		if(req.headers.auth === config.clientToken)
+		if(req.headers.auth !== config.clientToken)
 			return res.status(401).send('not-authorized')
 
 	db.table('gallery').select('id', 'name').then((data) => {
@@ -17,7 +17,7 @@ galleryController.list = function(req, res, next){
 galleryController.test = function(req, res, next){
 	
 	if(config.TOKEN === true)
-		if(req.headers.auth === config.clientToken)
+		if(req.headers.auth !== config.clientToken)
 			return res.status(401).send('not-authorized')
 
 	let testdata = [

+ 1 - 1
controllers/uploadController.js

@@ -18,7 +18,7 @@ const storage = multer.diskStorage({
 const upload = multer({
 	storage: storage,
 	limits: { fileSize: config.uploads.maxsize }
-}).single('file')
+}).single('files[]')
 
 uploadsController.upload = function(req, res, next){