Skip to content

Commit

Permalink
fix: Better detection of missing payload
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 committed May 4, 2020
1 parent d76df0a commit dc85b19
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/routes/[projectID].ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async function processIncomingMessage(
app: App,
req: FastifyRequest<any, QueryParams>,
projectID: string,
payload: string,
payload: string | undefined | null,
country?: string
) {
const perf = parseInt(req.query.perf || '-1') || -1
Expand All @@ -51,7 +51,7 @@ async function processIncomingMessage(
)
app.metrics.histogram(Metrics.xhrType, projectID, trackerXHR)
app.metrics.histogram(Metrics.dnt, projectID, req.headers.dnt === '1')
if (payload === undefined) {
if (!payload) {
req.log.warn({
msg: 'Missing payload',
projectID,
Expand Down

0 comments on commit dc85b19

Please sign in to comment.