kanadeko преди 7 години
родител
ревизия
3777c01465
променени са 2 файла, в които са добавени 3 реда и са изтрити 3 реда
  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){