devZenaight commited on
Commit
e130000
·
verified ·
1 Parent(s): e8f0390

Upload 5 files

Browse files
Files changed (1) hide show
  1. main.py +4 -4
main.py CHANGED
@@ -30,12 +30,12 @@ def verify(
30
  hub_challenge: Optional[str] = Query(None, alias="hub.challenge"),
31
  hub_verify_token: Optional[str] = Query(None, alias="hub.verify_token"),
32
  ):
33
- # 1) Meta's initial reachability probe: no params → OK
34
- if not hub_mode and not hub_challenge and not hub_verify_token:
35
  return PlainTextResponse(status_code=200, content="")
36
 
37
- # 2) Real handshake: echo back challenge if token matches
38
- if hub_mode == "subscribe" and hub_verify_token == VERIFY_TOKEN:
39
  return PlainTextResponse(content=hub_challenge or "", media_type="text/plain")
40
 
41
  # 3) Everything else → forbidden
 
30
  hub_challenge: Optional[str] = Query(None, alias="hub.challenge"),
31
  hub_verify_token: Optional[str] = Query(None, alias="hub.verify_token"),
32
  ):
33
+ # 1) Initial probe
34
+ if hub_mode is None and hub_challenge is None and hub_verify_token is None:
35
  return PlainTextResponse(status_code=200, content="")
36
 
37
+ # 2) Real handshake: echo back challenge (temporarily ignore token)
38
+ if hub_mode == "subscribe":
39
  return PlainTextResponse(content=hub_challenge or "", media_type="text/plain")
40
 
41
  # 3) Everything else → forbidden