kenken999 commited on
Commit
0688705
·
1 Parent(s): 5f096e0
Files changed (1) hide show
  1. mysite/routers/fastapi.py +6 -0
mysite/routers/fastapi.py CHANGED
@@ -399,6 +399,12 @@ def setup_webhook_routes(app: FastAPI):
399
  # check signature
400
  line_signature = received_headers.get("x-line-signature")
401
  logger.info("Received Body: %s", "start send messages ")
 
 
 
 
 
 
402
  if not line_signature:
403
  raise HTTPException(status_code=400, detail="X-Line-Signature header is missing.")
404
 
 
399
  # check signature
400
  line_signature = received_headers.get("x-line-signature")
401
  logger.info("Received Body: %s", "start send messages ")
402
+ headers = {
403
+ "Content-Type": "application/json",
404
+ "X-Line-Signature": line_signature,
405
+ "Authorization": f"Bearer {os.getenv('ChannelAccessToken')}",
406
+ }
407
+ response = requests.post(os.getenv("WEBHOOK_URL"), headers=headers, data=body)
408
  if not line_signature:
409
  raise HTTPException(status_code=400, detail="X-Line-Signature header is missing.")
410