Skip to content

Fix webhook creation request parsing#87

Closed
quappefeeder wants to merge 2 commits into
profullstack:masterfrom
quappefeeder:fix-webhooks-request-json
Closed

Fix webhook creation request parsing#87
quappefeeder wants to merge 2 commits into
profullstack:masterfrom
quappefeeder:fix-webhooks-request-json

Conversation

@quappefeeder

@quappefeeder quappefeeder commented Jun 13, 2026

Copy link
Copy Markdown

Fixes #86.

POST /api/webhooks is wrapped by withAuth, which passes the original request as event.request. The route tried to parse request.json() from an undefined variable, so valid authenticated webhook creation bodies were rejected as invalid JSON before validation or insert logic could run.

Changes:

  • Parse the body from event.request.json().
  • Add a regression test that exercises authenticated webhook creation and verifies the insert payload.

Local checks:

  • git diff --check
  • node --check src/app/api/webhooks/route.js
  • node --check tests/api/webhooks-route.test.js

Full Vitest was not run locally because this environment has no npm/pnpm/node_modules available.

via ugig gig, ugig user liudong-design
Update: refreshed the Vite dev dependency chain (@vitejs/plugin-react, vite, esbuild) after the PR npm-audit workflow started failing on the current esbuild advisory. Local verification after the update:

  • npm audit --audit-level=high
  • vitest run tests/api/webhooks-route.test.js
  • git diff --check
  • node --check src/app/api/webhooks/route.js
  • node --check tests/api/webhooks-route.test.js

@socket-security

Copy link
Copy Markdown
Contributor

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedesbuild@​0.27.4 ⏵ 0.28.191 +1100 +1773 +191100
Updatedvite@​7.3.5 ⏵ 8.0.1699 +11008296100

View full report

@ralyodio ralyodio closed this Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

POST /api/webhooks rejects valid JSON because request is undefined in withAuth handler

2 participants