Skip to content

Commit

Permalink
use DiscardUnknown
Browse files Browse the repository at this point in the history
  • Loading branch information
jibon57 committed Oct 17, 2023
1 parent c85b8d0 commit 922f94d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/controllers/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ func HandleWebhook(c *fiber.Ctx) error {
return c.SendStatus(fiber.StatusForbidden)
}

op := protojson.UnmarshalOptions{
DiscardUnknown: true,
}
event := new(livekit.WebhookEvent)
if err = protojson.Unmarshal(body, event); err != nil {
if err = op.Unmarshal(body, event); err != nil {
return c.SendStatus(fiber.StatusForbidden)
}

Expand Down

0 comments on commit 922f94d

Please sign in to comment.