Skip to content

Commit

Permalink
fix: netdata GET trigger 500 (google bot) (#1961)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahargl authored Sep 18, 2024
1 parent 231e07d commit 135e967
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion keep/api/routes/alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,11 @@ async def receive_generic_event(
description="Helper function to complete Netdata webhook challenge",
)
async def webhook_challenge():
token = Request.query_params.get("token").encode("ascii")
try:
token = Request.query_params.get("token").encode("ascii")
except Exception as e:
logger.exception("Failed to get token", extra={"error": str(e)})
raise HTTPException(status_code=400, detail="Bad request: failed to get token")
KEY = "keep-netdata-webhook-integration"

# creates HMAC SHA-256 hash from incomming token and your consumer secret
Expand Down

0 comments on commit 135e967

Please sign in to comment.