Commit 2a9632ad authored by Yoann HOUPERT's avatar Yoann HOUPERT

Merge tag 'content-type' into next

Patch content-type
parents 01fe4a81 1ffb9480
Pipeline #11558 passed with stage
in 38 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