Merge pull request 'Limit webhook body size to 1MB' (#52) from fix/webhook-body-limit into main

Reviewed-on: https://git.ts.mattnite.net/mattnite/forgejo-tickets/pulls/52
This commit is contained in:
Matthew Knight 2026-02-18 00:35:11 +00:00
commit eee2a0c6dd
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")
}
body, err := io.ReadAll(r.Body)
body, err := io.ReadAll(io.LimitReader(r.Body, 1<<20))
if err != nil {
return nil, fmt.Errorf("read body: %w", err)
}