Compare commits

...

2 Commits

Author SHA1 Message Date
62be2d30f3 print json 2022-02-21 02:25:35 +00:00
0c113739ee Remove json request 2022-02-21 02:25:20 +00:00
2 changed files with 3 additions and 1 deletions

View File

@@ -5,8 +5,8 @@ from fastapi.exceptions import HTTPException
async def auth_hook(request: Request): async def auth_hook(request: Request):
try: try:
json = await request.json()
text = await request.body() text = await request.body()
except: except:
raise HTTPException(status_code=204, detail="Missing or bad content") raise HTTPException(status_code=204, detail="Missing or bad content")
header_signature = request.headers.get('X-Hub-Signature') header_signature = request.headers.get('X-Hub-Signature')

View File

@@ -9,6 +9,8 @@ app.openapi = custom_openapi(app)
@app.get("/", dependencies=[Depends(auth_web)]) @app.get("/", dependencies=[Depends(auth_web)])
@app.post("/", dependencies=[Depends(auth_hook)]) @app.post("/", dependencies=[Depends(auth_hook)])
async def hook(req: Request): async def hook(req: Request):
json = await req.json()
print(json)
return "Update" return "Update"