better style
This commit is contained in:
parent
579cabdc1a
commit
6e0678e084
@ -189,7 +189,7 @@ function ifUnauthenticated(authenticated, description) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function ifInvalidContentType(req, description) {
|
function ifInvalidContentType(req, description) {
|
||||||
if ( ! req.headers['content-type'] || req.headers['content-type'].split(';')[0] != 'application/json' ) {
|
if (!req.is('application/json')) {
|
||||||
throw new Error(description);
|
throw new Error(description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user