Skip to content

Commit 60299d3

Browse files
authored
🐛 fix signature none (fix #2)
1 parent ecf698e commit 60299d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nonebot/adapters/github/adapter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ async def _handle_webhook(
7777
signature = request.headers.get("x-hub-signature-256")
7878
payload = request.content
7979

80-
if not event_id or not event_name or not signature or not payload:
80+
if not event_id or not event_name or not payload:
8181
log("WARNING", "Received invalid GitHub Webhook request. Missing Header.")
8282
return Response(400, content="Invalid Request")
8383

8484
# verify signature
85-
if app.webhook_secret is not None and not verify(
86-
app.webhook_secret, payload, signature
85+
if app.webhook_secret is not None and not (
86+
signature and verify(app.webhook_secret, payload, signature)
8787
):
8888
log(
8989
"WARNING",

0 commit comments

Comments
 (0)