mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
Fix event data check.
This commit is contained in:
parent
e4fe22233c
commit
4cc22fcc95
@ -84,7 +84,7 @@
|
||||
"maxmind": "^4.3.6",
|
||||
"moment-timezone": "^0.5.35",
|
||||
"next": "^12.3.1",
|
||||
"next-basics": "^0.23.0",
|
||||
"next-basics": "^0.24.0",
|
||||
"node-fetch": "^3.2.8",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prop-types": "^15.7.2",
|
||||
|
@ -35,9 +35,7 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => {
|
||||
let { url } = payload;
|
||||
|
||||
// Validate eventData is JSON
|
||||
const valid = eventData && typeof eventData === 'object' && !Array.isArray(eventData);
|
||||
|
||||
if (!valid) {
|
||||
if (eventData && !(typeof eventData === 'object' && !Array.isArray(eventData))) {
|
||||
return badRequest(res, 'Event Data must be in the form of a JSON Object.');
|
||||
}
|
||||
|
||||
|
@ -13,8 +13,8 @@ body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
color: var(--base800);
|
||||
background: var(--base100);
|
||||
color: var(--font-color100);
|
||||
background: var(--background200);
|
||||
}
|
||||
|
||||
.zh-CN {
|
||||
|
@ -5445,10 +5445,10 @@ natural-compare@^1.4.0:
|
||||
resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz"
|
||||
integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=
|
||||
|
||||
next-basics@^0.23.0:
|
||||
version "0.23.0"
|
||||
resolved "https://registry.yarnpkg.com/next-basics/-/next-basics-0.23.0.tgz#6ccc4b5f3cd87550b07d280c2a3bdee26f557912"
|
||||
integrity sha512-AwKipMFkxS84ZKFDVSo8ZHXoOVzF2sPZp21pgtGlqf9aUmj48+QtxdM6ZnJVRg8Savf48ENjeYzeiu5I8Z4l/w==
|
||||
next-basics@^0.24.0:
|
||||
version "0.24.0"
|
||||
resolved "https://registry.yarnpkg.com/next-basics/-/next-basics-0.24.0.tgz#21ebd34276b3a957b1f6c644de494cc1a17953ea"
|
||||
integrity sha512-N0wABIkzFpDIoxSEyeLZ8wNENLhcQtPqEY/mKLzpNfr4x4bQ0c5qnXEtrNEftWeQt0osjiuL5yFlnXOOQgTHpQ==
|
||||
dependencies:
|
||||
base-x "^4.0.0"
|
||||
bcryptjs "^2.4.3"
|
||||
|
Loading…
Reference in New Issue
Block a user