Skip to content

Commit

Permalink
support query args in json request
Browse files Browse the repository at this point in the history
  • Loading branch information
Finb committed Dec 26, 2021
1 parent b11ea5c commit 78f2e02
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions route_push.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ func routeDoPushV2(c *fiber.Ctx) error {
if err := c.BodyParser(&params); err != nil && err != fiber.ErrUnprocessableEntity {
return c.Status(400).JSON(failed(400, "request bind failed: %v", err))
}
// parse query args (medium priority)
c.Request().URI().QueryArgs().VisitAll(func(key, value []byte){
params[strings.ToLower(string(key))] = string(value)
})
return push(c, params)
}

Expand Down

0 comments on commit 78f2e02

Please sign in to comment.