parse-community / parse-community/parse-server

Webhooks not passing content-length header to POST request

Open
#7,646 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type:feature
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

New Issue Checklist
Issue Description

When using Moralis (built on top of Parse), I realized that the webhooks are not passing the content-length header to the POST request that Parse makes under the hood. This causes services like Vercel, which use body-parser under the hood, to receive an empty body in req.body. From looking at the code I don't see the content-header get added. I opened an issue in the moralis forum too: https://forum.moralis.io/t/webhooks-send-empty-body-to-vercel-api/3361/5.

Steps to reproduce
  1. Set up a webhook.
  2. Point the webhook to a Vercel serverless function: https://vercel.com/docs/concepts/functions/introduction.
  3. Trigger the webhook so it calls the Vercel serverless function. Inspect req.body and req.headers inside Vercel logs and see an empty body (where the moralis body was expected) and see that there is no content-length header.
Actual Outcome

The webhook data gets lost when calling the Vercel endpoint and the request body can't be used.

Expected Outcome

The content-length should be included in the webhook request so the JSON body can be correctly parsed by whoever is handling the webhook call.

Environment

Not sure what to put here. It happens in the latest version (from looking at the code).

Server

  • Parse Server version: not sure since I do not have access to know what version Moralis is using under the hood.
  • Operating system: same as above.
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): same as above.

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: same as above.
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): same as above.

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): JavaScript.
  • SDK version: same as above.
Logs

N/A

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing Parse Server's webhook POST request handling and reproduce the call against the Vercel serverless function described in the issue. Confirm that the request includes a content-length header and that the webhook JSON is available in req.body, then verify the behavior with a focused test if the relevant test location can be identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
express, javascript, nodejs
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.