1
0
Fork 0
mirror of https://github.com/YunoHost/apps.git synced 2024-09-03 20:06:07 +02:00

webhook: Server does not have a recent python, use optional[] instead of |

This commit is contained in:
root 2024-06-06 14:30:13 +00:00
parent 851de630f1
commit 3a2a24342e

View file

@ -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: