Limit webhook body size to 1MB

Fixes #21
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matthew Knight 2026-02-17 16:03:43 -08:00
parent e3ef03ddcd
commit f4049d3015
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ func VerifyWebhookSignature(r *http.Request, secret string) ([]byte, error) {
return nil, fmt.Errorf("missing X-Forgejo-Signature header") return nil, fmt.Errorf("missing X-Forgejo-Signature header")
} }
body, err := io.ReadAll(r.Body) body, err := io.ReadAll(io.LimitReader(r.Body, 1<<20))
if err != nil { if err != nil {
return nil, fmt.Errorf("read body: %w", err) return nil, fmt.Errorf("read body: %w", err)
} }