Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
Check for empty content-type header.
Mike Cao785d41b6d37c
diff --git a/.eslintrc.json b/.eslintrc.jsonindex e5f0cc94f..990e05819 100644--- a/.eslintrc.json+++ b/.eslintrc.json@@ -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": truediff --git a/lib/request.js b/lib/request.jsindex 89e9c6559..ba1c799b0 100644--- a/lib/request.js+++ b/lib/request.js@@ -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);}