...
 
Commits (4)
......@@ -23,6 +23,7 @@ const uuidv1 = require('uuid/v1');
const successCode = 200;
const badRequestCode = 400;
const noContentTypeCode = 406;
const interalServerCode = 500;
const routesFactory = config => {
......@@ -37,6 +38,10 @@ const routesFactory = config => {
return res.status(badRequestCode).send('No files were uploaded.');
}
if (req.get('content-type') === undefined) {
return res.status(noContentTypeCode).send('No content type given');
}
enhancer.enhancement(req.body, (err, response, body) => {
if (err) {
return res.status(interalServerCode).json({module: 'Enhancement', error: 'Error during audio enhancing', info: err.toString()});
......