mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-12-12 02:45:18 +00:00
Fixed handle verify signature when has failed
This commit is contained in:
parent
a975b32376
commit
b264f42e3d
1 changed files with 5 additions and 1 deletions
|
|
@ -51,7 +51,11 @@ async def get_body(request: Request):
|
|||
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}")
|
||||
try:
|
||||
verify_signature(body_bytes, webhook_secret, f"sha256={signature_header}")
|
||||
except Exception as ex:
|
||||
get_logger().error(f"Invalid signature: {ex}")
|
||||
raise HTTPException(status_code=401, detail="Invalid signature")
|
||||
|
||||
return body
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue