Skip to content
GitLab
Explore
Sign in
Commits on Source (4)
add content type empty
· 76a6c18a
Yoann HOUPERT
authored
Feb 28, 2018
76a6c18a
Merge branch 'hotfix/content-type' into production
· 1ffb9480
Yoann HOUPERT
authored
Feb 28, 2018
1ffb9480
Merge tag 'content-type' into next
· 2a9632ad
Yoann HOUPERT
authored
Feb 28, 2018
Patch content-type
2a9632ad
Merge branch 'next' into 'master'
· 0d4dcc47
Yoann HOUPERT
authored
Feb 28, 2018
Next See merge request
!7
0d4dcc47
Hide whitespace changes
Inline
Side-by-side
lib/webserver/routes.js
View file @
0d4dcc47
...
...
@@ -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
()});
...
...