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:
commit
eee2a0c6dd
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue