sfdsfsdf
This commit is contained in:
2026-04-03 18:45:09 +02:00
parent ecae89a79d
commit 983b67e6fc
4 changed files with 36 additions and 13 deletions

View File

@@ -59,9 +59,9 @@ app.use('/api', limiters.api)
// Static files
app.use(express.static(join(__dirname, '..', 'public')))
// Gitea webhook: raw body for X-Gitea-Signature verification (must be before JSON parser)
// Limit 2mb so large Gitea payloads (full repo JSON) don't get rejected and cause 502
app.use('/api/webhook', express.raw({ type: 'application/json', limit: '2mb' }))
// Gitea webhook: raw body for X-Gitea-Signature (must match signed bytes exactly).
// type: () => true — Gitea may send application/json; charset=utf-8 or similar; strict 'application/json' can skip parsing and leave body empty.
app.use('/api/webhook', express.raw({ type: () => true, limit: '2mb' }))
app.use('/api/webhook', webhookRoutes)
// Body parsing (BEFORE routes, AFTER static)