kenken999 commited on
Commit
5f096e0
·
1 Parent(s): 7d25f85
chat_history.db CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:30c65f13731f07ce3c496dbe33f97b7fd177418b1ab60a773a3b393be74c5598
3
- size 1490944
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:638551c43d5039696095babbc8b2544751ba2bd737d879063c3ce96125819c11
3
+ size 1511424
controllers/gpt_enginner20240625183244 ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit 5512b0c36b0422cfbd01c44ac9c9e3ed09fc29e4
controllers/gpt_enginner20240625183414 ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit 8f7fbbe7f45bd51296aeacae3aff97602935b1b2
mysite/routers/fastapi.py CHANGED
@@ -345,7 +345,7 @@ def setup_webhook_routes(app: FastAPI):
345
  stderr=subprocess.PIPE,
346
  text=True,
347
  )
348
- await asyncio.sleep(30)
349
  """
350
  proc = subprocess.Popen(
351
  command,
@@ -395,15 +395,15 @@ def setup_webhook_routes(app: FastAPI):
395
  "Content-Type": "application/json",
396
  }
397
  logger.info("Received Body: %s", "send data to appsheet ")
398
- response = requests.post(os.getenv("WEBHOOK_URL"), headers=headers, data=body)
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
 
405
- #if not validate_signature(body.decode("utf-8"), line_signature, os.getenv("ChannelSecret")):
406
- # raise HTTPException(status_code=400, detail="Invalid signature.")
407
 
408
  if not os.getenv("WEBHOOK_URL") or not os.getenv("WEBHOOK_URL").startswith("https://"):
409
  raise HTTPException(status_code=400, detail="Invalid webhook URL")
@@ -418,7 +418,7 @@ def setup_webhook_routes(app: FastAPI):
418
  logger.info("Forwarding Headers: %s", headers)
419
  logger.info("Forwarding Body: %s", body.decode("utf-8"))
420
 
421
- response = requests.post(os.getenv("WEBHOOK_URL"), headers=headers, data=body)
422
  responses = requests.post(os.getenv("WEBHOOK_GAS"), headers=headers, data=body)
423
  logger.info("Response Code: %s", response.status_code)
424
  logger.info("Response Content: %s", response.text)
 
345
  stderr=subprocess.PIPE,
346
  text=True,
347
  )
348
+ #await asyncio.sleep(30)
349
  """
350
  proc = subprocess.Popen(
351
  command,
 
395
  "Content-Type": "application/json",
396
  }
397
  logger.info("Received Body: %s", "send data to appsheet ")
398
+ #response = requests.post(os.getenv("WEBHOOK_URL"), headers=headers, data=body)
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
 
405
+ if not validate_signature(body.decode("utf-8"), line_signature, os.getenv("ChannelSecret")):
406
+ raise HTTPException(status_code=400, detail="Invalid signature.")
407
 
408
  if not os.getenv("WEBHOOK_URL") or not os.getenv("WEBHOOK_URL").startswith("https://"):
409
  raise HTTPException(status_code=400, detail="Invalid webhook URL")
 
418
  logger.info("Forwarding Headers: %s", headers)
419
  logger.info("Forwarding Body: %s", body.decode("utf-8"))
420
 
421
+ #response = requests.post(os.getenv("WEBHOOK_URL"), headers=headers, data=body)
422
  responses = requests.post(os.getenv("WEBHOOK_GAS"), headers=headers, data=body)
423
  logger.info("Response Code: %s", response.status_code)
424
  logger.info("Response Content: %s", response.text)