Wauplin HF staff commited on
Commit
dfcff08
1 Parent(s): d9c353a
Files changed (2) hide show
  1. gradio_webhooks.py +2 -0
  2. simple.py +1 -1
gradio_webhooks.py CHANGED
@@ -61,6 +61,8 @@ class GradioWebhookApp:
61
  print(
62
  "For more details about Webhook secrets, please refer to https://huggingface.co/docs/hub/webhooks#webhook-secret."
63
  )
 
 
64
  app.middleware("http")(self._webhook_secret_middleware)
65
 
66
  def add_webhook(self, path: str):
 
61
  print(
62
  "For more details about Webhook secrets, please refer to https://huggingface.co/docs/hub/webhooks#webhook-secret."
63
  )
64
+ else:
65
+ print("\nWebhook secret is correctly defined.")
66
  app.middleware("http")(self._webhook_secret_middleware)
67
 
68
  def add_webhook(self, path: str):
simple.py CHANGED
@@ -1,6 +1,6 @@
1
  from gradio_webhooks import GradioWebhookApp, WebhookPayload
2
 
3
- app = GradioWebhookApp()
4
 
5
 
6
  @app.add_webhook("/my_webhook")
 
1
  from gradio_webhooks import GradioWebhookApp, WebhookPayload
2
 
3
+ app = GradioWebhookApp(webhook_secret="my_dummy_secret")
4
 
5
 
6
  @app.add_webhook("/my_webhook")