Commit 76a6c18a authored by Yoann HOUPERT's avatar Yoann HOUPERT

add content type empty

parent b582542c
Pipeline #11557 failed with stage
in 49 seconds
......@@ -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()});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment