mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
Check for empty content-type header.
This commit is contained in:
parent
93f15bc44b
commit
785d41b6d3
@ -4,7 +4,7 @@
|
|||||||
"es2020": true,
|
"es2020": true,
|
||||||
"node": true
|
"node": true
|
||||||
},
|
},
|
||||||
"extends": ["eslint:recommended", "plugin:react/recommended", "prettier", "next"],
|
"extends": ["eslint:recommended", "plugin:react/recommended", "prettier"],
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaFeatures": {
|
"ecmaFeatures": {
|
||||||
"jsx": true
|
"jsx": true
|
||||||
|
@ -88,7 +88,7 @@ export async function getClientInfo(req, { screen }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getJsonBody(req) {
|
export function getJsonBody(req) {
|
||||||
if (req.headers['content-type'].indexOf('text/plain') !== -1) {
|
if ((req.headers['content-type'] || '').indexOf('text/plain') !== -1) {
|
||||||
return JSON.parse(req.body);
|
return JSON.parse(req.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user