From 10d73d8fc9339843febb373e00c5babd542b4580 Mon Sep 17 00:00:00 2001 From: jimmy Date: Sun, 1 Aug 2021 01:42:43 +0000 Subject: [PATCH] Change invalid branch to 202. Fix json check for ref --- app/auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/auth.py b/app/auth.py index dbf6b46..ac4e758 100644 --- a/app/auth.py +++ b/app/auth.py @@ -9,9 +9,9 @@ load_dotenv() async def check_ref(request: Request): json = await request.json() - if json["ref"] and json["ref"] == f"refs/heads/{os.environ.get('BRANCH')}": + if "ref" in json and json["ref"] == f"refs/heads/{os.environ.get('BRANCH')}": return - raise HTTPException(status_code=403, detail="Invalid branch") + raise HTTPException(status_code=202, detail="Invalid branch") async def auth_hook(request: Request): try: