From 8f19e1dc36f669d03a32907dae3c0afe016dcbdf Mon Sep 17 00:00:00 2001 From: root Date: Thu, 6 Jun 2024 14:30:13 +0000 Subject: [PATCH] webhook: Server does not have a recent python, use optional[] instead of | --- webhooks/webhook.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webhooks/webhook.py b/webhooks/webhook.py index 0bae51c..df30984 100755 --- a/webhooks/webhook.py +++ b/webhooks/webhook.py @@ -9,6 +9,7 @@ import tempfile import logging from pathlib import Path +from typing import Optional from git import Actor, Repo, GitCommandError from sanic import HTTPResponse, Request, Sanic, response @@ -64,7 +65,7 @@ async def github_post(request: Request) -> HTTPResponse: return response.json({"error": f"Unknown event '{event}'"}, 422) -def check_webhook_signatures(request: Request) -> HTTPResponse | None: +def check_webhook_signatures(request: Request) -> Optional[HTTPResponse]: logging.warning("Unsafe webhook!") header_signature = request.headers.get("X-Hub-Signature") if header_signature is None: