Webhook endpoint accepts all HTTP methods, should restrict to POST #20
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/webhooker#20
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
The webhook receiver endpoint at
/webhook/{uuid}accepts any HTTP method (GET, PUT, DELETE, HEAD, etc.) becauseroutes.gousesHandleFuncinstead of a method-specific handler:A GET request to a webhook endpoint creates an empty event with no body and queues deliveries to all targets. This could:
Fix
Use
router.Post()to restrict to POST only, or add method filtering in the handler:Note: The README documents this as
ANY /webhook/{uuid}which suggests it might be intentional. If so, the handler should still validate that the request has meaningful content for non-POST methods.Category
Should-fix for 1.0.