This repository has been archived on 2026-05-01. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
PolyNotFound/backend/app/config/checkFormat.config.js
2021-10-29 23:54:19 +02:00

9 lines
280 B
JavaScript

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