switch back to startsWith
This is because application/json;charset=utf8 is perfectly valid!
This commit is contained in:
parent
4259e89bb2
commit
1b7504a191
|
@ -17,7 +17,7 @@
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "prettier . --write"
|
"lint": "prettier . --write"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"prettier": "2.2.1"
|
"prettier": "2.2.1"
|
||||||
|
|
|
@ -12,7 +12,7 @@ router.use((req, res, next) => {
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req.headers['content-type'] !== 'application/json') {
|
if (!req.headers['content-type'].startsWith('application/json')) {
|
||||||
return res.status(415).send({
|
return res.status(415).send({
|
||||||
message: 'requests must be of type application/json',
|
message: 'requests must be of type application/json',
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue