mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
Check for empty content-type header.
This commit is contained in:
parent
93f15bc44b
commit
785d41b6d3
@ -4,7 +4,7 @@
|
||||
"es2020": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": ["eslint:recommended", "plugin:react/recommended", "prettier", "next"],
|
||||
"extends": ["eslint:recommended", "plugin:react/recommended", "prettier"],
|
||||
"parserOptions": {
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
|
@ -88,7 +88,7 @@ export async function getClientInfo(req, { screen }) {
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user