mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-04 21:00:40 +08:00
Fixed webhook security concern
This commit is contained in:
@ -47,6 +47,10 @@ async def get_body(request: Request):
|
||||
if webhook_secret:
|
||||
body_bytes = await request.body()
|
||||
signature_header = request.headers.get('x-gitea-signature', None)
|
||||
if not signature_header:
|
||||
get_logger().error("Missing signature header")
|
||||
raise HTTPException(status_code=400, detail="Missing signature header")
|
||||
|
||||
verify_signature(body_bytes, webhook_secret, f"sha256={signature_header}")
|
||||
|
||||
return body
|
||||
|
Reference in New Issue
Block a user