Change invalid branch to 202. Fix json check for ref
This commit is contained in:
@@ -9,9 +9,9 @@ load_dotenv()
|
|||||||
|
|
||||||
async def check_ref(request: Request):
|
async def check_ref(request: Request):
|
||||||
json = await request.json()
|
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
|
return
|
||||||
raise HTTPException(status_code=403, detail="Invalid branch")
|
raise HTTPException(status_code=202, detail="Invalid branch")
|
||||||
|
|
||||||
async def auth_hook(request: Request):
|
async def auth_hook(request: Request):
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user