Compare commits
2 Commits
a04f24fcff
...
62be2d30f3
Author | SHA1 | Date | |
---|---|---|---|
62be2d30f3 | |||
0c113739ee |
@@ -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')
|
||||||
|
@@ -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"
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user