This commit is contained in:
Yûki VACHOT 2021-10-29 23:54:19 +02:00
parent 5a64568824
commit a748b93133
7 changed files with 81 additions and 27 deletions

View file

@ -0,0 +1,9 @@
const {sendError} = require ("./response.config");
function checkFormat(req, res){
if(req.get('Content-Type') !== 'application/json') {
return sendError(res, 401, -1, "Invalid header format (please use JSON)");
}
return true; // Is valid
}
module.exports = checkFormat