Skip to content

fix: add request parameter to webhook_challenge for Netdata#6121

Merged
shahargl merged 1 commit intokeephq:mainfrom
lalalic:fix/netdata-webhook-challenge
Mar 22, 2026
Merged

fix: add request parameter to webhook_challenge for Netdata#6121
shahargl merged 1 commit intokeephq:mainfrom
lalalic:fix/netdata-webhook-challenge

Conversation

@lalalic
Copy link
Contributor

@lalalic lalalic commented Mar 21, 2026

Summary

Fixes #6116

The webhook_challenge endpoint for Netdata was calling Request.query_params.get() on the Starlette Request class instead of a request instance. Since query_params is an instance property, this raises AttributeError on every request — making the Netdata webhook challenge completely broken.

Root Cause

# Before (broken): calls .get() on the class, not an instance
async def webhook_challenge():
    token = Request.query_params.get("token").encode("ascii")

Fix

# After (fixed): inject request instance via FastAPI dependency
async def webhook_challenge(request: Request):
    token = request.query_params.get("token").encode("ascii")

Changes

  • Added request: Request parameter to webhook_challenge
  • Changed Request.query_paramsrequest.query_params

2-line fix. No tests needed — the bug is a straightforward Python instance vs class error.

)

The webhook_challenge function was calling Request.query_params.get()
on the Starlette Request *class* instead of a request *instance*,
causing AttributeError on every Netdata webhook challenge request.

Fix: add 'request: Request' parameter and use 'request.query_params'

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vercel
Copy link

vercel bot commented Mar 21, 2026

@lalalic is attempting to deploy a commit to the KeepHQ Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. Bug Something isn't working labels Mar 21, 2026
Copy link
Member

@shahargl shahargl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 22, 2026
@shahargl shahargl merged commit a907b35 into keephq:main Mar 22, 2026
5 of 6 checks passed
@github-actions
Copy link
Contributor

👏 Fantastic work @lalalic! Your very first PR to keep has been merged! 🎉🥳

You've just taken your first step into open-source, and we couldn't be happier to have you onboard. 🙌
If you're feeling adventurous, why not dive into another issue and keep contributing? The community would love to see more from you! 🚀

For any support, feel free to reach out on the community: https://slack.keephq.dev. Happy coding! 👩‍💻👨‍💻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

webhook_challenge crashes — uses Request class instead of request instance

2 participants